Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

TripleJ

macrumors regular
Original poster
Jul 30, 2008
128
0
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!
 

dgdosen

macrumors 68030
Dec 13, 2003
2,742
1,381
Seattle
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 (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

macrumors 68020
Jan 6, 2004
2,243
2,065
Dallas Texas
Its do-able! I am currently doing it by adding the following code to the controller of your TabBar:

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

	tabController.selectedIndex = JSON_TAB;
	
}
 

TripleJ

macrumors regular
Original poster
Jul 30, 2008
128
0
Its do-able! I am currently doing it by adding the following code to the controller of your TabBar:

Code:
- (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?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.