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

svjim

macrumors newbie
Original poster
Aug 27, 2008
11
0
I am building an UITabBar application using interface builder. The application has 3 tabs on it. The first tab is tied to a UIView and database and its sole purpose is to add data to the database. The second tab is a UITableView and its purpose in life is to display the data in the database. The third tab displays a graph of the data.

My issue concerns the UITableView and how to send it a message to reload it self from the first view which knows nothing of the tableview but does know when it has updated the database. So my question is how do a I get a pointer to the UITableView in the UIView so I can send the reloaddata message to the UITableView?

Thanks Jim
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Various ways.

I might prefer to do this with NSNotification/NSNotificationCenter. Have the database viewcontroller post a notification when the db is changed and have the tableviewcontroller register for that same notification.

Otherwise whatever controller creates the tabs, probably your app delegate, should pass the necessary information to the db viewController about the tableviewcontroller when they're created.
 

svjim

macrumors newbie
Original poster
Aug 27, 2008
11
0
NSNotificationCenter

Thanks, that did the trick. It took a bit to get the syntax correct as I was looking at a Mac OSX example and the code is slightly different. In the end, it was amazingly simple.

Jim
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.