iPhone UITableView trigger a parent method?
Posted
by MidnightLightning
on Stack Overflow
See other posts from Stack Overflow
or by MidnightLightning
Published on 2010-05-10T18:17:47Z
Indexed on
2010/05/10
18:34 UTC
Read the original article
Hit count: 438
iphone-sdk
Okay, so I'm working on an iPhone app with a preferences-esque section where there's a base TableView, which has one section, and several rows of customized cells to hold a name and a value label. Clicking on a row brings up another View, which allows the user to pick from a list (another TableView), and select an item.
All of these TableViews are done programatically. The base TableView has a property that holds a Controller instance for each of the "pick from the list" Views. Each of the "pick from the list" views has a property called chosenValue
that has the currently-selected option. I've gotten the UI to handle the didSelectRowAtIndexPath
to update the chosenValue
property and then "pop
" the view (going back to the main TableView). But, even though the main TableView's cellForRowAtIndexPath
method references the chosenValue
property of the subview that's held in a property, the view doesn't update when an item is selected. In short, how can the sub-view trigger a reloadData
on the parent object, after it "pops" and unloads?
© Stack Overflow or respective owner