- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier [email protected]"imageCell";
UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
NSData *imageData =UIImagePNGRepresentation([UIImage imageNamed:@"inbox.png"]);
PFObject *almacen = [_browserImagenes objectAtIndex:indexPath.row];
PFFile *archivo = almacen [@"image"];
[archivo getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {
UIImage *image = [UIImage imageWithData:imageData];
}
}];
return cell;
}
-4
A
回答
0
寫這樣的代碼在你的UITableView的cellForRowAtIndexPath方法...
PFFile *鏡像文件= [[yourArray objectAtIndex:indexPath.row] valueForKey:@ 「yourColumnName」];
if (imageFile) {
self.imageView.file = imageFile;
[self.imageView loadInBackground:^(UIImage *image, NSError *error) {
}];
}
+0
爲此使用PFImageView – 2014-10-03 10:42:47
0
您需要將下載的圖像分配給您忘記的單元格的UIImageView。我已經修改你的代碼如下。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier [email protected]"imageCell";
UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
NSData *imageData =UIImagePNGRepresentation([UIImage imageNamed:@"inbox.png"]);
PFObject *almacen = [_browserImagenes objectAtIndex:indexPath.row];
PFFile *archivo = almacen [@"image"];
[archivo getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {
UIImage *image = [UIImage imageWithData:imageData];
// *** Here you need to set image to imageview to display it ***
cell.imageView.image = image;
}
}];
return cell;
}
相關問題
- 1. 將許多圖像上傳到解析
- 2. 無法找到上傳圖像解析
- 3. 將圖像上傳到解析失敗
- 4. 從Picker上解析圖片上傳
- 5. 如何使用解析服務器從s3上傳圖像
- 6. Swift 3上傳圖像到解析服務器
- 7. 拍攝照片後上傳圖像進行解析
- 8. 解析由於圖像文件大小而無法上傳圖像
- 9. 上傳文件(圖片)解析
- 10. 使用解析API上傳圖片
- 11. 解析JSON圖像
- 12. UITableView和解析 - laggy
- 13. 在UITableVIew加載之前從解析中檢索圖像?
- 14. 解析圖像座標上的座標
- 15. 解碼base64圖像並上傳
- 16. 將圖像解析爲多個圖像
- 17. XML解析時上傳
- 18. 解析Android的上傳和
- 19. 上傳圖像
- 20. 解壓縮圖像使用UITableView
- 21. Android/iPhone圖像解析
- 22. 從解析下載圖像
- 23. 解析設置圖像javascript
- 24. 用jsoup解析圖像
- 25. 解析圖像目錄
- 26. 使用JAI解析圖像
- 27. RSS解析圖像Android
- 28. 解析圖像扔AFNetworking
- 29. Webpack無法解析圖像
- 30. 從解析下載圖像
這裏你想要什麼,請解釋清楚。你想要異步加載圖像嗎? – 2014-09-20 21:55:20
是的。我的圖像存儲在Parse.com – 2014-09-20 22:03:01
所以你想要在tableview中顯示這些圖像? – 2014-09-20 22:05:27