How do you launch a second MainWindow.xib in an iPad application?
Asked
Active
Viewed 135 times
2 Answers
2
You load the nib, most likely using NSBundle, and then call makeKeyAndVisible
on the window in the nib. The best way to get the window is to use an outlet in the object loading the nib.
[[NSBundle mainBundle] loadNibNamed:@"SecondWindow" owner:self options:nil];
[self.secondWindow makeKeyAndVisible]; //assuming the window was connected to a property named secondWindow

ughoavgfhw
- 39,734
- 6
- 101
- 123
0
Usually you don't. Instead, you transition to the new top level modal view controller (either in a xib or programmatically created) that would have been in your second MainWindow.

hotpaw2
- 70,107
- 14
- 90
- 153
-
ok, but what if I want a second MainWindow.xib? (For example, to create a new View with a SplitViewController)? Most feedback that this isn't something you want to do seems accurate, but how would I do it? (Even if it is wrong.) – MikeN Mar 02 '11 at 20:09