开发者

How to open a .xib from a button click

开发者 https://www.devze.com 2023-03-09 02:48 出处:网络
Can anyone please give me some idea how can I open a new .xib from a UI开发者_StackOverflow中文版Button? I meant that if I click on a button it will open a new window.Link the button\'s touch up insid

Can anyone please give me some idea how can I open a new .xib from a UI开发者_StackOverflow中文版Button? I meant that if I click on a button it will open a new window.


Link the button's touch up inside event to an IBAction method in your UIViewController subclass. In that method, instantiate a new UIViewController with your xib using:

YourViewControllerClass *vc= [[YourViewControllerClass alloc] initWithNibName:@"YourXibName" bundle:nil];

Then if you have a nav controller you want to push it onto:

[self.navigationController pushViewController:vc animated:YES];
[vc release];


NewTableController *newTableController=[[NewTableController alloc] initWithNibName:@"NewTableController" bundle:nil];
    [self.navigationController pushViewController:newTableController animated:YES];
0

精彩评论

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