I am working on a Universal app & would like to access the values stored in app-info.plist file in my code.
Reason: I instantiate a UIViewController dynamically from a storyboard using:
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
self = [storyboard instantiateViewControllerWithIdentifier:@"ExampleViewController"];
Now, having the storyboard name @"MainStoryboard_iPhone" above is ugly.
I want to do something like:
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:appInfo.mainStoryboardBaseNamePhone bundle:nil];
self = [storyboard instantiateViewControllerWithIdentifier:@"ExampleViewController"];
where appInfo can perhaps be an NSDictionary of all values in app-info.plist
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…