我有一个方法:
#define ROOT_ASSETS_PATH @"/assets/"
...
-(NSMutableDictionary*) getContentsOfPlist{
NSString *pageContentPlistPath = [[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent: ROOT_ASSETS_PATH] stringByAppendingPathComponent:@"content.plist"];
NSMutableDictionary *mDictionary = [NSMutableDictionary dictionaryWithContentsOfFile:pageContentPlistPath];
return mDicitonary;
}
在模拟器上。这将返回一个字典。在 iPad 上,它返回 nil。确保扩展案例也与呼叫中的案例相匹配。
有任何想法吗?