开发者

SplitVIewController Application with multipleDetailViews

开发者 https://www.devze.com 2023-04-12 21:47 出处:网络
I am just starting with iPad App development. I want to use splitViewController in my app. I want to use different viewControllers. These will be loaded on rightHandView of an ipad when user selects a

I am just starting with iPad App development. I want to use splitViewController in my app. I want to use different viewControllers. These will be loaded on rightHandView of an ipad when user selects appropriate o开发者_JAVA技巧n tableviewcontroller present on left hand.

I am using iOS SDK 5.0 without storyboard. I have seen apple's example of multipleDetailView and tried to follow similar procedure but its not working with iOS 5.0 sdk and Xcode4.2, I can not able to access MainWindow.Xib in my project as there is not one when you create project with XCode4.2 and master detail template.

Can anyone tell me how to approach this problem or direct me to appropriate resources ?

Regards, Sumit


It seems that compared to previous versions, XCode 4.2 generates the relevant code in the "AppDelegate.m" instead of somewhere in the .xib file. I'm not sure about how to work with a MainWindow.xib here, but you could easily push other view controllers in the detail view navigation controller programmatically:

Use the following code for example on a button touch up action:

- (IBAction)buttonClick:(id)sender {
    MySecondViewController *vc = [[MySecondViewController alloc] initWithNibName:@"MySecondViewController" bundle:nil];
    [self.navigationController pushViewController:vc animated:TRUE];
}

To dismiss the top controller and get back you can use either

[self.navigationController popViewControllerAnimated:TRUE];

in the new top-of-the-stack controller (here MySecondViewController) or just the Back button in the navigation bar.

0

精彩评论

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