UINavigationController inside tabbar loading a child root view

Posted by Doug on Stack Overflow See other posts from Stack Overflow or by Doug
Published on 2010-06-10T00:42:36Z Indexed on 2010/06/10 0:52 UTC
Read the original article Hit count: 709

Hi guys,

Firstly i'll preface by saying that i am a complete Cocoa touch/objective c noob (.Net dev having a dabble)

I have searched on Google as well as here but cannot seem to find an easy solution.

I have a UItabbarcontroller view with a UINavigationController inside its first tab

I have the root view for this UINavigationController stored in a seperate class and NIB as i am trying to seperate the data viewing from the data loading (i'm going to reuse the table list in multiple places in my database) and simply pass the root view its data using a loading method and have it take it from there.

What i want to happen:

  • App loads and loads the first view of the tab bar (A UINavigationController)
  • The UINavigationController inside the first view loads a root view (a UIViewController with a table view) and sets its title
  • The UINavigationController loads the data from a web service and parses it
  • The UINavigationController sends the data to a loading method inside the UIViewController

Am i thinking about this completely wrongly? What currently happens:

  • the first tab bar loads with an empty uinavigationcontroller (no table view)
  • the data methods fire and get the webservice data
  • this child view gets sent its data using the loading method
  • the tableview delegate events fail to fire inside the child view telling it to load the data into the table

I just can't seem how to load my second view inside the root view of the navigation controller and then send it my data?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone-sdk