如何从按钮打开.xib点击

问题描述:

任何人都可以请给我一些想法如何从UIButton打开新的.xib?我的意思是,如果我点击一个按钮,它会打开一个新窗口。如何从按钮打开.xib点击

将按钮触及的内部事件链接到UIViewController子类中的IBAction方法。在该方法中,实例化一个新的UIViewController与厦门国际银行使用:

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

然后,如果你有一个导航控制器,你想把它推到:

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

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