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

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
Hello,

Im planning to construct a simple drill-down application with a book-like structure (MAIN => CHAPTER (1-n) => PART (1-n) -> PAGE (1-n)) accoding to this schema:



As you can see, I want to drill down from MAIN to CHAPTER(i) , and from CHAPTER(i) to PART (j), all by using a navigationBar.

When reaching PART (j), I want to be able to traverse the pages (PAGE (1-n)) in that section by using a tabBar at the bottom of the screen.

Ive gone trough a couple of tutorials but am still trying to wrap my head around some core aspects:

1) I understand I need a NavigationController (by default "RootNavigationController" if chosing a Navigation-based project) for the drill-down from and to MAIN <-> CHAPTER (1-n).

But what about the natigation between CHAPTER (1-n) <-> PART (1-n)? Do I use the same NavigationController here, or do I need to construct a new one for each of the CHAPTERs?

2) Is it possible to use a use a ToolBar for navigation at the bottom of the hierarchy to switch between PAGE (1-n)? The reason I ask is that Ive come across a tutorial saying a NavigationBar may be nested within a TabBar, but not the other way around. This despite the fact that the photo-view application i iPhone does in fact use a TabBar to switch between photos at the lowest level of the hierarchy (ie. it is nested within the NavigationBar).

Thanks in advance,
Daniel
 

Garrett

macrumors regular
Apr 4, 2007
173
0
Hello,

Im planning to construct a simple drill-down application with a book-like structure (MAIN => CHAPTER (1-n) => PART (1-n) -> PAGE (1-n)) accoding to this schema:



As you can see, I want to drill down from MAIN to CHAPTER(i) , and from CHAPTER(i) to PART (j), all by using a navigationBar.

When reaching PART (j), I want to be able to traverse the pages (PAGE (1-n)) in that section by using a tabBar at the bottom of the screen.

Ive gone trough a couple of tutorials but am still trying to wrap my head around some core aspects:

1) I understand I need a NavigationController (by default "RootNavigationController" if chosing a Navigation-based project) for the drill-down from and to MAIN <-> CHAPTER (1-n).

But what about the natigation between CHAPTER (1-n) <-> PART (1-n)? Do I use the same NavigationController here, or do I need to construct a new one for each of the CHAPTERs?

2) Is it possible to use a use a ToolBar for navigation at the bottom of the hierarchy to switch between PAGE (1-n)? The reason I ask is that Ive come across a tutorial saying a NavigationBar may be nested within a TabBar, but not the other way around. This despite the fact that the photo-view application i iPhone does in fact use a TabBar to switch between photos at the lowest level of the hierarchy (ie. it is nested within the NavigationBar).

Thanks in advance,
Daniel
Mind me asking what program you used for that?
 

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
Hi Garret!

Sorry if I was unclear, but Im trying to do this in XCode with the iPhone sdk.

Or did you mean the schema-figure? Just paint in Winxp :)
 

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
1. No you don't need to create a new one you can always use:
[self.navigationController pushViewController:<your controller instance> animated:YES];

2. Yes you can use a TabController within a NavigationController. See this thread for some hints: http://www.iphonedevsdk.com/forum/i...ing-uinavigationcontroller-tabcontroller.html

Hi sfwalter, and thanks for the answers :)

1) So you mean that a projects single controller instance will automatically understand which level of the hierarchy it is in, and push downwards (alternatively pop upwards) to the next level? Thats pretty great :)

2) Thanks for the link - that will come in handy. However, Ive been messing around with the code-examples supplied by apple dev center, specifically the "PageControl"-example. Can I use either PageController or TabController at the lowest level? And if so, are there any pros/cons to either one?
 

rockman

macrumors newbie
Jan 1, 2009
3
0
this is similar to my current project, and I am having a problem, wondering if anyone has an idea on what I am missing.

I have a navigationController in which I push a tabBarcontroller, showing two views. (both of which work perfectly), What I am having trouble wiring up is that I want to pushViewController a different view, thereby drilling down antoher level, Leaving behind the tabBar view. I am using IB mainly, but just need this to finish this project.

When I "click" on the tableView row that is in the TabBar, nothing happens. The only thing I can think is that the message isnt reaching the navBar. I have tried sending a message from the app delegate without luck as well.

anyone have any ideas on things I should make sure that I have in place? thanks

- (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

[self.navigationController pushViewController:testImageController animated:YES];
 

rockman

macrumors newbie
Jan 1, 2009
3
0
Fugured it out, wasnt using escapsluation well.
[self.tabBarController.navigationController pushViewController:testImageController animated:YES];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.