【发布时间】:2014-01-21 15:48:55
【问题描述】:
我希望能够加载我在 Core Data 中拥有的数据。
我想出了如何保存它,但是加载它会引发 __NSarray 长度错误,NSLog 怎么能很好地读取数据??!?
我正在尝试用核心数据中的数据填充我的UITextView
我正在使用 MagicalRecord 来管理我的核心数据
NSArray *people = [TextView MR_findByAttribute:@"belongsTo" withValue:@"barneDaabStartSide" andOrderBy:nil ascending:NO];
textView1.text = [people valueForKey:@"textDataView"];
我也试过这个:
NSMutableString *textViewText = [NSMutableString string];
for (NSString *str in people) {
[textViewText appendFormat:@"%@\n", str];
self.textView1.text = textViewText;
}
但是它只是写了各种代码,然后是我的字符串“数据”,所以这不能正常工作
【问题讨论】:
-
如果它发生在哪一行/函数/类?
-
@GrzegorzKrukowski on textView1.text = ....
-
NSArray *people; textView1.text = [人 valueForKey:@"textDataView"]; //
-
@geo ???你这是什么意思?
标签: ios objective-c core-data uitextview magicalrecord