2012-03-09 18 views
2

iOS開発の初心者で、.plistのファイルがiOSでどのように機能するかを知りたいと思います。どのようにして.plistとの間で書き込みデータを読み取るかの例を私に教えてもらえますか?iOSでの.plistファイルの動作方法

+0

http://stackoverflow.com/questions/5853735/how-can-we-create-:ファイルへの書き込みは

NSString *rootPath = [[NSBundle mainBundle] bundlePath]; NSString *pListPath = [rootPath stringByAppendingPathComponent:@"Settings.bundle/Root.plist"]; NSDictionary *pList = [NSDictionary dictionaryWithContentsOfFile:pListPath]; 

あまりにもハードのどちらかではありません独自のplist-in-a-xcodeプロジェクト –

答えて

7

うん:

NSDictionary *dict; 
NSData *data = [NSPropertyListSerialization dataWithPropertyList:dict format:NSPropertyListXMLFormat_v1_0 options:0 error:&error]; 
[data writeToFile:self.saveToPath atomically:YES]; 
関連する問題