migratePersistentStore:toURL:options:withType:error:
永続ストア先を移行します
-(id)migratePersistentStore:(id)store: toURL:(NSURL *)URL: options:(NSDictionary *)options: withType:(NSString *)storeType: error:(NSError **)error:
解説
永続ストア先を移行します。
save as...で新しく保存先を指定してから使います
返り値
( id )
オブジェクト()
引数
( id )store
( NSURL * )URL
( NSDictionary * )options
( NSString * )storeType
( NSError ** )error
フレームワーク
CoreData
クラス
NSPersistentStoreCoordinator
Instance Methods
使用可能
10.4
参照
-addPersistentStoreWithType:configuration:URL:options:error:
-removePersistentStore:error:
例文
NSURL *oldURL = [NSURL fileURLWithPath:@"/Users/oomori/Desktop/aaa.binary"]; NSURL *newURL= [NSURL fileURLWithPath:@"/Users/oomori/Desktop/abc.sql"]; NSError *error = nil; id xmlStore = [psc persistentStoreForURL:oldURL]; id sqLiteStore = [psc migratePersistentStore:xmlStore toURL:newURL options:nil withType:NSSQLiteStoreType error:&error];