I have my app mapped out using storyboards where there is an entry screen that segues to a tabbarcontroller which contains 3 tabs. Each tab contains a splitviewcontroller and I have written classes for each master and detail view controller. The bit I’m not sure on is how to give each masterviewcontroller (that controls the table on the left hand side) a reference to the detailviewcontroller.
I can see in the attributes inspector there is an identifier field, should i put something in here for the detailviewcontroller (e.g. ‘detailviewcontroller1) and then somehow get that object by it’s instance name in code?
Both your master and detail view controllers will have a property,
splitViewController, that holds a pointer to the split view controller.The split view controller has a property,
viewControllers, which holds an array of the view controllers contained in the split view. This array will always contain 2, and only 2, view controllers – at index 0 is the master controller, and at index 1 is the detail controller.