English 中文(简体)
TableView To Navigation Controller on the View-Based Application Project?
原标题:

I built an application. On the one my views I used TableView. So now I want to change this Table view to a navigation controller.

1- How can I change UITable view to Navigation Controller.؟

最佳回答

The easiest way to achieve this is to create a new Navigation-based Application . This will set up everything you need. By default this will set you up with simple RootViewController, if you want you can change this to be your TableViewController by editing the application delegate

- (void)applicationDidFinishLaunching:(UIApplication *)application {    

    // Override point for customization after app launch    

    RootViewController *rootViewController = (RootViewController *)[navigationController topViewController];
    rootViewController.managedObjectContext = self.managedObjectContext;

    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];
}

All you need to do is copy your TableViewController into the new project and change the RootViewController to be yours

问题回答

If you have started with one of the template project in XCode find the .xib file for your view and launch InterfaceBuilder by double clicking the .xib file. You can manipulate the view directly by dragging and dropping components as well as adding components from a palette.

I would walk through one of Apples tutorials and get a feel for working with InterfaceBuilder - this tutorial shows adding a view controller.

Thank you everybody . finally i figured out :D , just put this code :

UINavigationController *myNav=[[UINavigationController alloc] initWithRootViewController:[[YourViewController alloc] initWithNibName:@"YourViewController" bundle:nil]];
    [self presentModalViewController:myNav animated:YES];




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签