I have 4 seperate tableViews which, when selected do a modal segue to a tabBarController containing four tabs. Of those four tabs they all have a common tab which performs an XML parse.
Ive done some reading and it seems I have three ways of doing it.Either I can
A) Use a class to define where the data is coming from but I don’t want to instantiate all the options
B) Find out what the current TabBarController is and use that as a condition
c) Find out where we segued from and use that data
Which would be the best way to perform this action, and how would I do it(the segue is working with data being passed). Please note that I am not using the UINavigationController.
I basically want to end up with a switch performing the functions based on where its coming from.
Well, you could use a singleton.
You could also create a data model and pass pointers to it to your various classes, as needed.
As for using a switch, just setup your data with an index of some sort, such as an array, and pull it based on the current tab bar object. If you plan to use
UITabBarControllerthen call itsselectedIndexproperty to know which tab bar item is selected.