Drill-down application structure [img]

Discussion in 'iOS Programming' started by Danneman101, Aug 14, 2008.

  1. Danneman101 macrumors 6502

    Joined:
    Aug 14, 2008
    #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:

    [​IMG]

    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
     
  2. Garrett macrumors regular

    Joined:
    Apr 4, 2007
    #2
    Mind me asking what program you used for that?
     
  3. Danneman101 thread starter macrumors 6502

    Joined:
    Aug 14, 2008
    #3
    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 :)
     
  4. sfwalter macrumors 68000

    sfwalter

    Joined:
    Jan 6, 2004
    Location:
    Dallas Texas
    #4
  5. Danneman101 thread starter macrumors 6502

    Joined:
    Aug 14, 2008
    #5
    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?
     
  6. rockman macrumors newbie

    Joined:
    Jan 1, 2009
    #6
    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];
     
  7. rockman macrumors newbie

    Joined:
    Jan 1, 2009
    #7
    Fugured it out, wasnt using escapsluation well.
    [self.tabBarController.navigationController pushViewController:testImageController animated:YES];
     

Share This Page