plist其实是一个xml文件
首先我们需要读取制定的文件
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@“myOlders” ofType:@“plist”];
然后我们就可以从中读取相应的数据,这里我们数据的最外边是一个数组,这样我们从指定的路径中就可以获取相应的数据。
NSArray *all Older s =[[NSArray alloc] initWithContentsOffile:plistPath];
关于数据字典,例如:
NSDictionary *tmpInfo = [dictionary objectForKey: @”Student”];
self.stuName.text = [NSString stringWithFormat:@”%@”, [tmpInfo objectForKey: @”Name”]];
self.stuSex.text = [NSString stringWithFormat:@”%@”, [tmpInfo objectForKey: @”Sex”]];
self.stuNum.text = [NSString stringWithFormat:@”%@”, [tmpInfo objectForKey: @”Num”]];
通过制定的名字找到对应的数据。