我正在开发一个通用应用程序,并且想在我的代码中访问存储在 app-info.plist 文件中的值。
原因:我使用以下方法从情节提要动态地实例化 UIViewController:
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
self = [storyboard instantiateViewControllerWithIdentifier:@"ExampleViewController"];
现在,上面的故事板名称@“MainStoryboard_iPhone”很丑。
我想做类似的事情:
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:appInfo.mainStoryboardBaseNamePhone bundle:nil];
self = [storyboard instantiateViewControllerWithIdentifier:@"ExampleViewController"];
其中 appInfo 可能是 app-info.plist 中所有值的 NSDictionary