小编use*_*434的帖子

从桌面到iphone的核心数据图像

我构建了一个与iPhone应用程序一起使用的简单mac数据输入工具.我最近添加了使用简单绑定通过Image Well添加的缩略图.它是一种可转换的数据类型,似乎工作正常.

但iPhone应用程序不会显示图像.该属性不为null但我无法显示图像.以下是cellForRowAtIndexPath

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}

NSManagedObject *entity = nil;
if ([self.searchDisplayController isActive])
    entity = [[self filteredListContent] objectAtIndex:[indexPath row]];
else
    entity = [fetchedResultsController objectAtIndexPath:indexPath];
cell.textLabel.text = [entity valueForKey:@"name"];
//cell.imageview.image = [UIImage imageNamed:@"ImageB.jpeg"]; //works fine
cell.imageView.image = [entity valueForKey:@"thumbnail"];//no error, but no file

return cell;
Run Code Online (Sandbox Code Playgroud)

我正在考虑问题是可转换的(我使用的是默认的NSKeyedUnarchiveFromData),或者我是如何调用缩略图的.我是新手,所以任何帮助都将不胜感激.

iphone core-data imageview nsmanagedobject

10
推荐指数
1
解决办法
6695
查看次数

标签 统计

core-data ×1

imageview ×1

iphone ×1

nsmanagedobject ×1