macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

metadataForPersistentStore:

現在ストアしている、又は永続ストアにストアしようとしているメタデータの内容の辞書を返します
-(NSDictionary *)metadataForPersistentStore:(id)store:

解説

現在ストアしている、又は永続ストアにストアしようとしているメタデータの内容の辞書を返します。

返り値

( NSDictionary * )

なし

引数

( id )store

クラス

NSPersistentStoreCoordinator

Instance Methods

使用可能

10.4

参照

-metadataForPersistentStoreWithURL:error:
-setMetadata:forPersistentStore:

例文

NSPersistentStoreCoordinator *psc = [[self managedObjectContext] persistentStoreCoordinator];
	id pStore = [psc persistentStoreForURL:oldURL];
	if (pStore != nil) {
    NSMutableDictionary *metadata = [[psc metadataForPersistentStore:pStore] mutableCopy];
    [metadata setObject:[NSArray arrayWithObject:@"Version 1"]  forKey:@"Version"];
    [psc setMetadata:metadata forPersistentStore:pStore];