I have a UITableView in a UINavigationController. On the navigation bar I have a button called add. When this button is pressed it presents a UIPopoverController, where user can input data to be added as a new row/cell in the UITableView. My issue is how can I add a new cell to the UITableView from the UIPopover? Do I pass in the array data to the UIPopOver root controller?
Share
There are two solutions to this that I’m aware of. One would be to send a notification from the popover to the root controller and apply the necessary code to update the tableView in the
handleNotificationmethod.The other, one that I personally use, is to set up a delegate protocol for the popover. You’ll have to set it up something like this:
Then in your root view controller header file, you need to add the delegate
Then in your root view controller implementation file, assign the popover delegate when you instantiate it. For example:
Finally, you’ll add your protocol method somewhere in the code
Sorry that’s a bit long. I just wanted to make sure I was thorough. Hope it helps