Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

Graves Robber
($1.99)

African Adventure
($0.99)

iTazer
($0.99)

ArtStudio
($3.99)

Pigs Vs Wolves
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-26-2009, 10:53 PM   #11 (permalink)
eddietr
Registered Member
 
Join Date: Apr 2009
Posts: 536
Default

So to be honest I didn't quite understand what you said there. And it's entirely possible that you didn't understand what I wrote either.

So I'll just try to explain it again and see if that helps?

So your categorias view controller needs to the root controller of your nav controller.

So right now you do this:

Code:
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
When it really should be more like this:

Code:
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:catViewController];
See how you should specify your categorias controller as your root controller when you create your UINavigationController?

Of course this means you need to do this after you have created your categorias controller.

Then that nav controller needs to be the first tab in your tab bar controller.

So right now you have this:

Code:
    tabBarController.viewControllers = [NSArray arrayWithObjects:catViewController, negViewController, sitViewController, favViewController, ranViewController, nil];
but really what you should do is more like this:

Code:
    tabBarController.viewControllers = [NSArray arrayWithObjects:navController, negViewController, sitViewController, favViewController, ranViewController, nil];
You see the navController should be first, not the catViewController. That's where your mistake is.

Also, you shouldn't add the navController's view to the window directly. So just delete this line all together:

Code:
	[window addSubview:navController.view];
That line needs to go because you're adding your tab bar controller's view to the window instead. That view is what should be the top of the hierarchy.
eddietr is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 23,681
Threads: 38,445
Posts: 168,922
Top Poster: smasher (2,541)
Welcome to our newest member, kai
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:23 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.