Kyu*_*ubi 0 cocoa-touch core-data ios restkit
我有一个简单的循环:
for(Object_ *obj in not.object)
{
......
Object *objStor = [NSEntityDescription insertNewObjectForEntityForName:@"Object" inManagedObjectContext:context];
.....
}
Run Code Online (Sandbox Code Playgroud)
'Object_'类的接口如下所示:
@interface Object_ : NSObject
@property (nonatomic, strong) NSNumber * id;
@property (nonatomic, strong) NSString * name;
@property (nonatomic, strong) NSNumber * review_id;
.
.
.
.
@end
Run Code Online (Sandbox Code Playgroud)
'Object'类的接口(由xCode for Core Data Schema创建)如下所示:
@interface Object : NSManagedObject
@property (nonatomic, retain) NSNumber * id;
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSNumber * rating;
.
.
.
.
@end
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
*** NSForwarding: warning: object 0x1a1bb48 of class 'Object' does not implement methodSignatureForSelector: -- trouble ahead
*** NSForwarding: warning: object 0x1a1bb48 of class 'Object' does not implement doesNotRecognizeSelector: -- abort
Run Code Online (Sandbox Code Playgroud)
在线解决方案称将'Object'Class声明为NSObject的子类.但我无法将继承更改为NSObject,因为这会导致Core Data Model失败.
我上面还有另一条线,
Subject *subStor = [NSEntityDescription insertNewObjectForEntityForName:@"Subject" inManagedObjectContext:context];
Run Code Online (Sandbox Code Playgroud)
哪作得很好.是什么导致错误?
| 归档时间: |
|
| 查看次数: |
2550 次 |
| 最近记录: |