我需要向我的 plist 写入一个字符串,但是找不到 plist,为什么?
在.h
NSMutableDictionary *cameras;
.m 文件
#define DOCUMENTS [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]
在 ViewDidLoad
NSString *plistPath = [DOCUMENTS stringByAppendingPathComponent:@"Сamera.plist"];
if([[NSFileManager defaultManager] fileExistsAtPath:plistPath])
{
NSData *plistXML = [[NSFileManager defaultManager] contentsAtPath:plistPath];
cameras = [NSMutableDictionary dictionaryWithDictionary:[NSPropertyListSerialization propertyListFromData:plistXML mutabilityOption:NSPropertyListMutableContainersAndLeaves format:nil errorDescription:nil]];
}