I have a view that has an “Add” button in its navigation bar. When clicking that button, it slides up a modal view with a form for them to add their item. I would like to inform the calling view controller (the one that had the “Add” button) that the expense has been added so it can do any updating it needs to do. Is there any way to get access to the view controller that initiated the modal view?
Share
There are two ways that come to mind. Either create a protocol that your modal view uses to inform the calling viewController or by having your modal view post a NSNotification that the calling view controller is observing. In the case of posting the notification, you would send the expense in the userInfo dictionary of the NsNotification object.
Good luck