你好我想要的代碼波紋管,我不能讓我的圖像顯示PFQueryTableViewController解析。不加載圖像
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object
{
static NSString *CellIdentifier = @"Cell";
PFTableViewCell *cell = (PFTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[PFTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// Configure the cell
cell.textLabel.text = [object objectForKey:@"venueName"];
cell.imageView.file = [object objectForKey:@"image"];
[cell.imageView.file getDataInBackgroundWithBlock:^(NSData *data, NSError *error){
cell.imageView.image = [UIImage imageWithData:data];
}];
return cell;
}
我也嘗試:
[cell.imageView loadInBackground];
並沒有什麼。我需要在單元格中手動插入UIImage嗎?
問候
第一個我認爲你應該修復你的格式文章。關於你的問題,你確定[object objctForKey:@「image」]是否返回PFFile? – HoanNguyen
對不起格式。是的文件正在下載。我使用NSLog打印它們 – Camus
不要執行'getDataInBackgroundWithBlock:'部分。 'image'屬性是一個佔位符,以防遠程圖像不可用。 –