plist

作者: 970517 | 来源:发表于2018-10-26 08:03 被阅读0次

// ======= 获取资源文件路径 ========
// 获取资源文件路径
NSString *path = [[NSBundle mainBundle]pathForResource:@"QQData.plist" ofType:nil];

// 获取字典 所有的数据
dic = [NSDictionary dictionaryWithContentsOfFile:path];

// 获取所有的 key (标题)
arr = [dic allKeys];

// 获取该商品对应的数据
NSArray *dataArr = [dic objectForKey:arr[indexPath.row]];

=================================

NSString *path = [[NSBundle mainBundle]pathForResource:@"group.plist" ofType:nil];
dic = [NSDictionary dictionaryWithContentsOfFile:path];
// 装的都是小组(arr[小组名1,小组名2,小组名3])
groupArr = [dic allKeys]

return groupArr.count;

NSString *str = groupArr[section]; // -->第一组
// 通过编号 拿到小组 arr[武璐昶,杨洁,郭晓东,赵晓君];
peopleArr = [dic objectForKey:str];
//
return peopleArr.count;

// 拿到组号.
NSString *str = groupArr[indexPath.section];
// 根据组号 从dic取出每小组
peopleArr = [dic objectForKey:str];

相关文章

  • iOS 通过plist下载 ipa

    plist格式

  • 本地存储plist 抽取方法

    储存plist数据 获取plist数据 删除plist文件

  • 字典转模型详解

    第一级别 加载plist文件,直接面对字典开发 设置plist文件(死数据):plist文件 加载plist以及面...

  • plist

    // ======= 获取资源文件路径 ========// 获取资源文件路径NSString *path = [...

  • Plist

    plist是什么? 它全名是:Property List,属性列表文件,它是一种用来存储串行化后的对象的文件。属性...

  • plist

    作用:plist文件只能存储NSString、NSData、NSDate、NSNumber、BOOL、NSArra...

  • Plist

    Plist文件书写 AppDelegate.h AppDelegate.m DataBase.h DataBase...

  • plist

    main .hmain

  • Property List 数据持久化

    plist 文件, 全名是 Property List 因为文件以 .plist 结尾,所以通常叫做 plist ...

  • iOS中.Plist文件和.json文件的使用

    iOS -- .Plist 文件 什么是Plist文件 为什么使用Plist文件 iOS -- .json 文件的...

网友评论

      本文标题:plist

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