开发者

How to open a .xib from a button click

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜