IOS

//1 可读取,不可写入工程下的plist文件;

//    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"OfficialDoc" ofType:@"plist"];

    

    //2 Document 沙盒中的文件(没有文件可自动创建)

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

    NSString *documentsDirectory = [paths objectAtIndex:0];

    _plistPath = [documentsDirectory stringByAppendingPathComponent:@"OfficialDoc.plist"];

    _docPlist = [[NSMutableDictionary alloc] initWithContentsOfFile:_plistPath];

    if (!_docPlist) {

        NSLog(@"new list");

        _docPlist = [NSMutableDictionary dictionary];

    }

    NSLog(@"init-----%@",_docPlist);

原文地址:https://www.cnblogs.com/tx8899/p/4084860.html