从Core Data获取数据后,我遇到问题。 我从获取的数据中填充了一个TableView,但TableView在其中显示了以下数据
(实体:Fortune; id:0x6549c40; data:)
有人可以告诉我我做错了什么吗? 以下是我用来填充TableViewCell的代码
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"] autorelease]; Fortune *info = [fetchedObjects objectAtIndex:indexPath.row]; cell.textLabel.text = info.description; return cell;}
Fortnue是我的托管对象类,描述是NSString类型的列。
问候。
I have a problem after the data being fetched from Core Data. I filled a TableView from the fetched data but the TableView shows the following data in it
(entity: Fortune; id: 0x6549c40 ; data: )
Can anybody tell me what I am doing wrong? Below is the code I used to fill TableViewCell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"] autorelease]; Fortune *info = [fetchedObjects objectAtIndex:indexPath.row]; cell.textLabel.text = info.description; return cell;}
Where Fortnue is my Managed Object Class and description is the column of type NSString.
Regards.
最满意答案
[object description]; 是一个返回实例描述,内存地址等等的默认方法。你不应该为NSManagedObject任何属性使用名称'description'。
[object description]; is a default method returning the description of the instance, memory address etc. You should not use the name 'description' for any of your properties of an NSManagedObject.
更多推荐
发布评论