简体   繁体   中英

how to create a menu based ios application in xcode 4.2

I have no idea how to set up a menu based project in xcode 4.2.

Basically, the menu has 4 buttons in it each go to their own Navigation Controlled tableviews, but I'm not sure where to start with xcode 4.2.

In my previous application I have a main window that has the navigation controller in that, then there is a root view which sets up the 4 buttons and from there the tableview view controllers just get loaded into the navigation controller.

With xcode 4.2 I cannot seem to set the delegate of the main window, so I cannot figure this out.

So I am hoping someone understands what I am trying to do and can help me out or send me a example or tutorial or something. Thanks, any help would be greatly appreciated.

Here is how I setup my navigation controller and root view in the AppDelegate file. From there you can just add the buttons and so on just as before. If you mean to do it with the storyboard, it will be much easier. Let me know if I misunderstood the question though:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.

    [self managedObjectModel];
    [self managedObjectContext];

    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    self.window.backgroundColor = [UIColor whiteColor];

    RootViewController *controller = [[RootViewController alloc] initWithNibName:nil bundle:nil];

    UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:controller];

    [self.window setRootViewController:navigation];
    [controller release];
    [navigation release];
    [self.window makeKeyAndVisible];

    return YES;
}

You'll be fine with one UINavigationController. In your view with the 4 menu buttons just hide the UINavigationController.

Hide / Show UINavigationController

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM