I am using a Master-Detail template.
I have a segmented control in the detail view and I have set the MasterViewController as the delegate.
This enables me to give the user choices.
I know the segmented control is working and passing the choices to the MVC.
I want each choice to trigger a new set of data which can then be loaded into the table view in the MasterViewController.
My problem is that I cannot then find a way to update the data in the table view.
You can use an instance variable declared in
MasterViewControllerto be updated whileUISegmentedControlchanges. Based on that, When you come back to theMasterViewController; use itsviewWillAppearto[tableView reloadData]Tell me if I am getting your question wrong.
EDIT:
Take an
integername itsegmentIndex; update as and when Segment gets changed. Based on the value ofsegmentIndexload thedataSourceneeded to be displayed onUITableViewof yourMasterViewControllerEDIT 2:
When
UISegmentedControl‘s value changes, putmvc.segmentIndex = (currentValueOfYourSegmentedControl);Then in
MasterViewController‘sviewWillAppearHope You Get My Point.