- (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. 从UITableView网站解析图像
- 5. 传递UITableView的解析XML
- 6. 未知异常,同时试图上传图像解析
- 7. 从Picker上解析图片上传
- 8. 将多个图像上传到解析服务Android Java
- 9. 上传/保存选定的图像与解析作为后端
- 10. 拍摄照片后上传图像进行解析
- 11. 如何将图像上传到解析在android中?
- 12. 如何上传选择的图像来解析对象?
- 13. Swift 3上传图像到解析服务器
- 14. 如何使用解析服务器从s3上传图像
- 15. 解析由于图像文件大小而无法上传图像
- 16. 上传文件(图片)解析
- 17. 使用解析API上传图片
- 18. 解析JSON图像
- 19. NSXML解析图像
- 20. UITableView和解析 - laggy
- 21. 解析XML到UITableView
- 22. 在UITableVIew加载之前从解析中检索图像?
- 23. iOS XML解析在UItableview中获取图像
- 24. UITableView Cell上的图像
- 25. 解析图像坐标上的坐标
- 26. 将Wordpress JSON解析为iOS上的UITableView
- 27. JSON解析:在UITableView上显示数据
- 28. 解码base64图像并上传
- 29. 将图像解析为多个图像
- 30. CSV上传Rails中解析
这里你想要什么,请解释清楚。你想要异步加载图像吗? – 2014-09-20 21:55:20
是的。我的图像存储在Parse.com – 2014-09-20 22:03:01
所以你想要在tableview中显示这些图像? – 2014-09-20 22:05:27