addPersistentStoreWithType:configuration:URL:options:error:
データを保持するタイプを追加します
-(id)addPersistentStoreWithType:(NSString *)storeType: configuration:(NSString *)configuration: URL:(NSURL *)storeURL: options:(NSDictionary *)options: error:(NSError *)error:
解説
データを保持するタイプを追加します。
オブジェクトNSPersistentStoreCoordinatorを返します
返り値
( id )
NSPersistentStoreCoordinator
引数
( NSString * )storeType
保持するデータの形式
( NSString * )configuration
( NSURL * )storeURL
保存する場所
( NSDictionary * )options
( NSError * )error
フレームワーク
CoreData
クラス
NSPersistentStoreCoordinator
Instance Methods
使用可能
10.4
参照
-migratePersistentStore:toURL:options:withType:error:
-removePersistentStore:error:
例文
NSURL *url; url = [NSURL fileURLWithPath: [applicationSupportFolder stringByAppendingPathComponent: @"CoreData001.xml"]]; if ([coordinator addPersistentStoreWithType:NSXMLStoreType configuration:nil URL:url options:nil error:&error]){ managedObjectContext = [[NSManagedObjectContext alloc] init]; [managedObjectContext setPersistentStoreCoordinator: coordinator]; }