开发者

How do you launch a second MainWindow.xib in an iPad application?

开发者 https://www.devze.com 2023-02-14 18:00 出处:网络
How do you launch a second MainWindow.xib in an iPa开发者_如何学God application?You load the nib, most likely using NSBundle, and then call makeKeyAndVisible on the window in the nib. The best way to

How do you launch a second MainWindow.xib in an iPa开发者_如何学God application?


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号