美文网首页
iOS读取plist文件

iOS读取plist文件

作者: 小明好爱学习 | 来源:发表于2019-07-19 10:53 被阅读0次

    百度搜到的太多废话,我这直接上代码

        NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"address" ofType:@"plist"];
        //当数据结构为数组时
        NSArray *array = [[NSArray alloc] initWithContentsOfFile:plistPath];
        //当数据结构为非数组时
        NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
    

    相关文章

      网友评论

          本文标题:iOS读取plist文件

          本文链接:https://www.haomeiwen.com/subject/qwljlctx.html