Iphone 如何加载另一个nib文件?
如何从基于视图的应用程序加载另一个nib文件Iphone 如何加载另一个nib文件?,iphone,Iphone,如何从基于视图的应用程序加载另一个nib文件 我在根nib文件中添加了按钮。。。。单击按钮,我需要加载另一个nib文件。应用程序内代理使用此 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launc
我在根nib文件中添加了按钮。。。。单击按钮,我需要加载另一个nib文件。应用程序内代理使用此
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Add the view controller's view to the window and display.
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
[window addSubview:navigationController.view];
[window makeKeyAndVisible];
return YES;
}
及
在控制器类中使用:
-(IBAction)buttonClick:(id)sender{
SecondViewController *_secondView = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
[self.navigationController pushViewController:_secondView animated:YES];
}
它会很好的。。。。。享受
谢谢大家。@ranjeet sajwan…你能告诉我详细的方法吗。。。非常感谢我添加了新的类UIViewController子类…名为abcd。。。。。我为该uiviewcontroller创建了新的abcd nib。。。。。单击按钮时,我添加了一个新按钮。我需要加载的nib文件:我创建了基于视图的应用程序的项目ControllerMusic*music=[[ControllerMusic alloc]initWithNibName:@“BusinessUser”bundle:nil];[self.view addSubview:music.view];[音乐发布];我在-(iAction)播放列表中使用此按钮按下:(id)发件人