在项目中,经常需要读取配置文件,现在就来看看读取plist配置文件的代码
NSBundle *bundle = [NSBundle mainBundle]; NSString *plistPath = [bundle pathForResource:@"fileName" ofType:@"plist"]; NSDictionary *dict = [[NSDictionary alloc]initWithContentsOfFile:plistPath];
时间: 2024-08-05 16:52:41