Update parent in UINavigationController from SubView
Forgive me if this has been asked/answered already but I couldn't find it anywhere (at least no in Monotouch - vaguely answer for ObjC. So completely new to Monotouch but I have everything completed in my application that I want with one exception. I'm trying to update a parent of a subview.
Here is the scenario:
I 开发者_如何学Pythonhave a UINavigationController with a UIView (not a table) which has a few buttons on it that directs via a PushViewController to a Subview. I make some changes on the subview, which I would like reflected back on the parent. I can of course add a manual refresh button if I wanted but was looking for something a little better.
I did see some things that referred to using a viewWillAppear but couldn't find any good examples. My attempts failed pretty bad, so any suggestions would be great.
Thanks,
Richard
If you have a UINavigationController
, it has a "back" button on top. Once this is hit by the user (or if you pop to a previous view controller), the currently view controller shown will trigger ViewWillDisappear
and ViewDidDisappear
and the view below (the one with your buttons) will fire ViewWillAppear
and ViewDidAppear
. Just overload those and update your UI state in there.
精彩评论