2017-01-06 5 views
0

CoreDataとMagicalRecordを初めて使用しました。私はこれを私のAppDelegateに持っていて、どうして問題があるのか​​わかりません。MagicalRecord create entity nil

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
    [MagicalRecord setupCoreDataStack]; 
    NSManagedObjectContext *context = [NSManagedObjectContext MR_defaultContext]; 
    NSEntityDescription *desc = [NSEntityDescription entityForName:@"GFSetModel" inManagedObjectContext:context]; 
    GFSetModel *test = [GFSetModel MR_createEntityInContext:context]; 
    return YES; 
} 

desc何らかの理由で常にnilであるとMR_createEntityInContext通話entityForName: inManagedObjectContext:contextいるので、それがゼロにもテストオブジェクトを作ります。私は異なるデフォルトのコンテキストを試しました。私は間違って何をしていますか?

答えて

0

ああ、私は.xcdatamodeldを作っていないし、それが理由でした。

関連する問題