「C/C++」plistの値を読み取る

参考コード:
//ファイルのパスを取得
NSString *path = [[NSBundlemainBundle] pathForResource:@"user.plist"ofType:@""];
//データを取得
NSMutableDictionary* dict = [ [ NSMutableDictionaryalloc ] initWithContentsOfFile:path ];
NSString* object = [ dict objectForKey:@"aaa" ];
NSLog(object);

//データの変更
NSMutableDictionary* dict = [ [ NSMutableDictionaryalloc ] initWithContentsOfFile:path ];
[ dict setObject:textview.text forKey:@"bbb" ];
[ dict writeToFile:path atomically:YES ];

Development

Posted by arkgame