2016-05-03 8 views
0

属性がエンティティに追加され、親エンティティが削除されたため、新しいモデルが作成されました。その後、DBからの新しいモデルでは、管理対象オブジェクトはロードできません。古いDBに戻すと、管理オブジェクトが表示されます。私は間違って何をしていますか?軽量移行後に管理対象オブジェクトが表示されない

答えて

0

忘れて追加:NSMigratePersistentStoresAutomaticallyOption,。

今では永続ストアの負荷は次のようになります。

var error: NSError? 
do { 
    try coordinatorMain.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: mainDB, options: [NSSQLitePragmasOption: ["journal_mode" : "DELETE"], NSMigratePersistentStoresAutomaticallyOption: true, NSInferMappingModelAutomaticallyOption: true]) 
} catch var error1 as NSError { 
    error = error1 
} 
関連する問題