سؤال

To move between VCs on a single storyboard, I use the first custom segue from the post : bidirectional storyboard travel without stacking This replaces the window's root view controller with the destination view controller, so the VCs do not stack and cause memory allocation issues.

I need to use multiple storyboards and so I am after a method of moving to a second storyboard that replaces the windows root controller with the initial VC of the new storyboard (I.e in a similar way to the custom segue I have used throughout the rest of the project.)

The solution should ideally work for IOS6 & IOS7 (the pseudo-segue method has been updated to IOS7 only)

Any ideas?

هل كانت مفيدة؟

المحلول

You can't do this with a segue. Segues can only be made between controllers in the same storyboard. The only way to do this, is in code by instantiating that first controller, and setting it as the window's root view controller.

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"SomeOtherStoryboard" bundle:nil];
NewController *new = [sb instantiateInitialViewController];
self.view.window.rootViewController = new;
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top