iOS开发之读取info.plist配置信息

第一种

1
[[NSBundle mainBundle].infoDictionary objectForKey:@"key"];

第二种

1
2
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
NSMutableDictionary *infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:bundlePath];

Key可能和你想的不太一样

所以可以直接把所有信息打印出来

然后在取Key