从 objective - c 中的不同 plist 文件中读取值
Read values from a different plist file in objective - c
我必须从我的 objective - c 代码中的 ~/Library/Preferences 中的 plist 中读取一个值。
我该如何实现?
NSString *path =[NSHomeDirectory() stringByAppendingString:@"/Library/Preferences"];
NSDictionary *dict =[NSDictionary dictionaryWithContentsOfFile:[[path stringByAppendingPathComponent:@"filename"] stringByAppendingPathExtension:@"plist"]];
通过这个你得到完整的 plist 作为字典
我必须从我的 objective - c 代码中的 ~/Library/Preferences 中的 plist 中读取一个值。
我该如何实现?
NSString *path =[NSHomeDirectory() stringByAppendingString:@"/Library/Preferences"];
NSDictionary *dict =[NSDictionary dictionaryWithContentsOfFile:[[path stringByAppendingPathComponent:@"filename"] stringByAppendingPathExtension:@"plist"]];
通过这个你得到完整的 plist 作为字典