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

MACloop

macrumors 6502
Original poster
May 18, 2009
393
0
Germany
Hello,
I have tried to implement an Accelerator in an app. The idea is to let the user update the values in a tableView by shaking the iPhone. In my AppDelegate I have an accelator and it seems to work allright. The problem is that I have a startTableViewController working as a menue. The user may click one of the cells to get to different tableViews showing data of different kind. One of these tableViews should be updated when the iPhone was shaken. What I cannot figure out is how to let the tableViewController and the AppDelegate communicate here. When the view is loaded with a current tableView is the data taken from a variable in the appDelegate with this kind of code:
Code:
self.theTableList = [(AppDelegate*)[[UIApplication sharedApplication] delegate] someTableList];
So being in the current tableView and shaking the phone will update the list in the AppDelegate, but how do I tell the current tableview to reload the data?

Any advices on this?

MACloop
 
Hello,
I have tried to implement an Accelerator in an app. The idea is to let the user update the values in a tableView by shaking the iPhone. In my AppDelegate I have an accelator and it seems to work allright. The problem is that I have a startTableViewController working as a menue. The user may click one of the cells to get to different tableViews showing data of different kind. One of these tableViews should be updated when the iPhone was shaken. What I cannot figure out is how to let the tableViewController and the AppDelegate communicate here. When the view is loaded with a current tableView is the data taken from a variable in the appDelegate with this kind of code:
Code:
self.theTableList = [(AppDelegate*)[[UIApplication sharedApplication] delegate] someTableList];
So being in the current tableView and shaking the phone will update the list in the AppDelegate, but how do I tell the current tableview to reload the data?

Any advices on this?

MACloop

I solved it with the NSNotificationCenter - I hope that is a "good" solution?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.