Question

I am parsing an XML document containing two branches from one XML document of the same sort of item (Topics and Schools), connected by a tabBarController.

Right now, Topics is populated, but I do not know the right way to go about populating Schools:

Should I create another viewController for School, or have some kind of conditional statement/selector sharing space with Topics in the existing viewController? If its the latter, then how?

I want to do this right the first time, Please know that I know almost nothing. Thank you.

Was it helpful?

Solution

If both information will be presented in the same way within a cell of the table, you should use the same viewcontroller, what will change is the datasource. You can create a custom init method with an additional type parameter which can assume the values "Topics" or "Schools" and based on this value fill the array, from xml file, with appropriate elements.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top