代码很简单
- NSString * path = [[NSBundle mainBundle] pathForResource:@"resource" ofType:@"plist"];
- self.resource = [[[NSDictionary alloc] initWithContentsOfFile:path] autorelease];
这样应该是没有错误的,我们可以看出来path是没有问题的(debug中),就是第二句返回nil
把这个plist从工程移除,再添加进去,就好了!!为什么呢,tell me why!!
转载于:https://blog.51cto.com/bhlzlx/988452