views:

58

answers:

1

I have app delegate.h & .m files linked to a Main.Nib.

Nib has a window and a tabbar controller which has 4 navigation controllers. Each of these 4 do their own thing inside 4 more Nib's containing tableview controllers etc.

The tableview controllers take their data from arrays manipulated in the app delegate. All work fine and i have no problems switching between tabs, pushing view controllers around and getting refreshing the objects in my app delegate. This is because the information is stored within sqlite.

Now it gets a bit trickier..

On my app delegate, I have some code that pulls json from the web and stores it inside object arrays. This json changes depending on what I'm doing inside one of the tableview controller nibs. Depending on the info I need, I call my app delegate from inside one of the tableview controllers and ask for more json.

Problem I'm having is this...

Once the connection is finished and the objects have been populated, I need to tell one (or more) of my tableview controllers to reload their data from the object arrays in my app delegate. The time it takes to load these objects obviously varies with the NSURLConnection.

What (I think) I need to do is this...

In my app delegate connectionDidFinishLoading, I want to call a method inside my tableview controllers...

Something along the lines of...

[self.tabbarcontroller.navigationcontroller(x).viewselected(x) call_method_to_reload_table_inside_this_view];

However, the Main.Nib has been set up to load the 4 other nibs through IB.

My question is this...

How do I know what they are called or how do I access them from my app delegate?

If I had of ignored IB and coded this by hand, I would have had control over their object names.

I can't seem to work out how the Main.Nib and the 4 other Nib's get initialised and accessed from the app delegate.

Hope this makes sense...

A: 

After a little more research, I realised that I needed to use the NSNotificationCenter.

A few lines of code later and all is working very well indeed :)

iphone_developer