我创建的捆绑包不显示。以下代码仅打印出应用程序包,而我添加了我的自定义包。但这不会用 NSLog 打印出来。
for (id obj in [NSBundle allBundles]) {
NSLog(@"Bundle Data= %@",obj);
};
只是,它输出的是ApplicationName .bundle。
所以,有什么想法为什么不注销添加的捆绑包
在意识到未加载捆绑包后添加了新代码。
NSString *bundlePath=[[NSBundle mainBundle] pathForResource:@"myBundle" ofType:@"bundle"];
NSBundle *myBundle=[[NSBundle alloc] initWithPath:bundlePath];
[myBundle load];
for (id obj in [NSBundle allBundles]) {
NSLog(@"Bundle Data= %@",obj);
};
这现在正在注销以下行:
2013-03-05 18:55:37.248 MyApp[414:c07] Bundle Data= NSBundle </Users/MyUser/Library/Application Support/iPhone Simulator/6.1/Applications/8DA9E19E-5028-4654-A0E0-251372B08139/MyApp.app> (loaded)
2013-03-05 18:55:37.250 MyApp[414:c07] Bundle Data= NSBundle </Users/MyUser/Library/Application Support/iPhone Simulator/6.1/Applications/8DA9E19E-5028-4654-A0E0-251372B08139/MyApp.app/myBundle.bundle> (not yet loaded)