Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.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
 

» Advertisements
» Online Users: 635
21 members and 614 guests
ADY, AragornSG, Dattee, denied, Duncan C, john love, kapps11, Keys, klrichner, mapiko, peppinoss, poisenden, Punkjumper, Robiwan, sle39lvr, smithdale87, Speed, spiderguy84, themathminister, timle8n1, wiggi
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,745
Threads: 89,201
Posts: 380,564
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Ashleyk27
Powered by vBadvanced CMPS v3.1.0

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