我在iOS6/iOS6应用程序中混合了多个故事板和NIB文件.
内存管理如何与多个故事板一起使用?
我使用多个与nib文件混合的故事板的原因:
我的代码片段
在InitialNibFile.m里面 - 从appdelegate启动.
- (IBAction)newStoryboardBtnPressed:(id)sender {
[self.view removeFromSuperview]; // here I remove this view from the superview to save memory
UIStoryboard *newStoryboard = [UIStoryboard storyboardWithName:@"NewStoryboard" bundle:nil];
UIViewController *initialSettingsVC = [newStoryboard instantiateInitialViewController];
[self presentViewController:initialSettingsVC
animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud)
这里,在故事板场景中的UIViewController视图内.
- (IBAction)anotherStoryboardBtnPressed:(id)sender {
// I'm inside a storyboard right now. I'm calling another storyboard.
// can i remove this storyboard before i launch the otherone? will keeping 2 or 3 toryboards …Run Code Online (Sandbox Code Playgroud)