2019独角兽企业重金招聘Python工程师标准>>>
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
//读取自定义的 plist文件的写法
// NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"customInfo" ofType:@"plist"];
// NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
// NSLog(@"dictionary = %@",dictionary);
//将学生信息填入
// NSDictionary *tmpInfo = [dictionary objectForKey:@"Student"];
// self.txtStuName.text = [NSString stringWithFormat:@"%@", [tmpInfo objectForKey:@"Name"]];
// self.txtStuSex.text = [NSString stringWithFormat:@"%@", [tmpInfo objectForKey:@"Sex"]];
// self.txtStuNum.text = [NSString stringWithFormat:@"%@", [tmpInfo objectForKey:@"Num"]];
//将导师信息填入
// tmpInfo = [dictionary objectForKey:@"Mentor"];
// self.txtMtName.text = [NSString stringWithFormat:@"%@", [tmpInfo objectForKey:@"Name"]];
// self.txtMtSex.text = [NSString stringWithFormat:@"%@", [tmpInfo objectForKey:@"Sex"]];
//读取系统产生的 plist文件的写法
NSDictionary *plistDic = [[NSBundle mainBundle] infoDictionary];
NSLog(@"plistDic = %@",plistDic);
//将学生信息填入
NSDictionary *tmpInfo = [plistDic objectForKey:@"Student"];
self.txtStuName.text = [NSString stringWithFormat:@"%@", [tmpInfo objectForKey:@"Name"]];
self.txtStuSex.text = [NSString stringWithFormat:@"%@", [tmpInfo objectForKey:@"Sex"]];
self.txtStuNum.text = [NSString stringWithFormat:@"%@", [tmpInfo objectForKey:@"Num"]];
//将导师信息填入
tmpInfo = [plistDic objectForKey:@"Mentor"];
self.txtMtName.text = [NSString stringWithFormat:@"%@", [tmpInfo objectForKey:@"Name"]];
self.txtMtSex.text = [NSString stringWithFormat:@"%@", [tmpInfo objectForKey:@"Sex"]];
}