【问题标题】:Parse.com PFImageview URL doesn't workParse.com PFImageview URL 不起作用
【发布时间】:2014-01-07 14:28:55
【问题描述】:

我无法通过 URL 解析 PFIMageView。我已经写了一个问题,移动了一点,但应用程序仍然无法运行。我运行并得到这个错误,没有加载。

图片有错误:http://postimg.org/image/jys3hqegt/

上一个问题:Parse.com adding images via URL

@interface TableViewController ()

@end @implementation TableViewController


 @synthesize colorsTable;

 - (void) retrieveFromParse {

     PFQuery *retrieveColors = [PFQuery queryWithClassName:@"Hracky1"];
     [retrieveColors findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
         if (!error) {
             colorsArray = [[NSArray alloc] initWithArray:objects];
         }
         [colorsTable reloadData];
     }];
     [self.colorsTable reloadData];
     [self.refreshControl endRefreshing]; }

 - (id)initWithStyle:(UITableViewStyle)style {
     self = [super initWithStyle:style];
     if (self) {
         // Custom initialization
     }
     return self; }
 - (void)viewDidLoad {
     [super viewDidLoad];

     [self performSelector:@selector(retrieveFromParse)];


     UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];

     self.refreshControl = refreshControl;

     [refreshControl addTarget:self action:@selector(retrieveFromParse) forControlEvents:UIControlEventValueChanged]; }

 - (void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];
     // Dispose of any resources that can be recreated. }


 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     // Return the number of sections.
     return 1; }

 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     // Return the number of rows in the section.
     return colorsArray.count; }

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     static NSString *CellIdentifier = @"colorsCell";



 CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

 PFObject *tempObject = [colorsArray objectAtIndex:indexPath.row];

 [cell.imageview setFile: [tempObject objectForKey:@"ImageURL"]];



 [cell.imageview loadInBackground];


 cell.cellTitle.text = [tempObject objectForKey:@"cellTitle"];


cell.cellDescript.text = [tempObject objectForKey:@"cellDescript"];

     return cell; }



 @end

【问题讨论】:

标签: ios url imageview runtime-error parse-platform


【解决方案1】:

你是否检查了该行的对象:[tempObject objectForKey:@"ImageURL"]?

我想你可以通过跟踪对象的 URL 来找到一些信息。

【讨论】:

  • 我做到了,我认为一切正常,但我仍然收到该错误
猜你喜欢
  • 2023-03-16
  • 2016-05-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-08-23
相关资源
最近更新 更多