PDA

View Full Version : Tab Bar Controller




TripleJ
Aug 2, 2008, 10:26 AM
This is probably really simple, but I've struggled with it for two days so if anyone could help me out with this I'd be immensely grateful!

I'm using the NavBar template from apples samplecode and i want to link one of the options to a view with a tab bar. I can get the tab bar working seperately but the second I link it to the navbar, it displays but stops doing anything. if anyone could point me in the right direction or help me fix this I'll do their dishes for the rest of the year! :D

Thank you so much!



louden
Aug 2, 2008, 01:00 PM
This is probably really simple, but I've struggled with it for two days so if anyone could help me out with this I'd be immensely grateful!

I'm using the NavBar template from apples samplecode and i want to link one of the options to a view with a tab bar. I can get the tab bar working seperately but the second I link it to the navbar, it displays but stops doing anything. I've put the source code Here (http://www.megaupload.com/?d=3FQMHXHW) (check the third entry (pagethreeviewcontroller) for the stuck tab bar) so if anyone could point me in the right direction or help me fix this I'll do their dishes for the rest of the year! :D

Thank you so much!

As far as I know - you can't!

You can have a navigation controller on each tab, but not vice versa. Apple mentioned this at the WWDC. Why would a tab view go away? You could do it if you show something modally over the whole window.

sfwalter
Aug 2, 2008, 09:00 PM
Its do-able! I am currently doing it by adding the following code to the controller of your TabBar:


- (void)viewDidLoad {
[super viewDidLoad];
self.view = tabController.view;

tabController.selectedIndex = JSON_TAB;

}

louden
Aug 3, 2008, 12:45 AM
I think it would go against Apple's UI Guidelines, but if it feels right then go ahead.

TripleJ
Aug 3, 2008, 03:15 AM
Its do-able! I am currently doing it by adding the following code to the controller of your TabBar:


- (void)viewDidLoad {
[super viewDidLoad];
self.view = tabController.view;

tabController.selectedIndex = JSON_TAB;

}


Worked perfectly! You are officially my hero!
I don't understand though, is this against the agreement or is it just that apple thinks it's weird design?