简体   繁体   English

从settings.bundle访问root.strings?

[英]accessing root.strings from settings.bundle?

I am using settings bundle for my app. 我正在为我的应用程序使用设置捆绑包。 I could not access root.plist and root.strings file of settings bundle from the following code. 我无法从以下代码访问设置捆绑包的root.plist和root.strings文件。 Could anyone help? 有人可以帮忙吗?

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *plist = [[NSBundle mainBundle] pathForResource:@"Root" ofType:@"plist"];
NSDictionary *rootofplist = [NSDictionary dictionaryWithContentsOfFile:plist];
NSArray *preferenceitems = (NSArray *) [rootofplist valueForKey:@"PreferenceSpecifiers"];
}

iPhone区分大小写,请尝试使用@“ root”而不是@“ Root” ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM