【发布时间】:2013-05-23 13:05:17
【问题描述】:
在我的应用程序中,我无法使用以下代码获取 plist。我正在使用 Xcode 4.5 这是我检索 plist 的代码,
NSBundle *thisBundle = [NSBundle mainBundle];
NSDictionary *theDictionary;
NSString *commonDictionaryPath;
if (commonDictionaryPath = [thisBundle pathForResource:@"newfonts-Info" ofType:@"plist"])
{
theDictionary = [[NSDictionary alloc] initWithContentsOfFile:commonDictionaryPath];
}
注意:-如果我尝试检索文本或 xml 文件,那么上面的代码可以正常工作。
【问题讨论】: