问题
I'm trying to load a view controller that's in a .storyboard in a pod. I'm using the following which normally works:
UIStoryboard *storyboard = [UIStoryboard
storyboardWithName:@"StoryboardName" bundle:nil];
NewViewController *newView = [storyboard instantiateViewControllerWithIdentifier:@"NewViewController"];
[self.navigationController pushViewController:newView animated:YES];
What do I need to change it to so I can load from a pod?
回答1:
You should load it with it's bundle identifier
NSBundle* bun = [NSBundle bundleWithIdentifier:"id"]
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardName" bundle:bun];
来源:https://stackoverflow.com/questions/50354684/objective-c-load-storyboard-from-a-pod-framework