我有一个充满地点的plist。我有地址,没有纬度或经度。我希望应用程序在用户想要查看位置的详细信息时进行地理编码。但是,我还希望应用程序将纬度和经度写回plist,以便下次我可以跳过地理编码。有没有办法在plist中只写两个值? plist位于文档目录中。
非常感谢任何帮助或示例项目参考
利奥
答案 0 :(得分:0)
NSDictionary
有方法可以将其内容读/写到plist:
NSString* filePath = @""; // set file path here
NSMutableDictionary* pListValues = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
// modify pListValues here
BOOL success = [pListValues writeToFile:filePath atomically:YES];
[pListValues release];