tags:

views:

16

answers:

1

i have a doubt which i want to clear

1) lets say i have 4 button on tabbar and they are loading tableVC when you press them, so can i use same tableVC for all??

2) ok lets say i am using different tableVC but then you press on detail section , t*hen can i use same detailSection VC for all others ,*

or i need seperate tableVC and seperate DetailSectionVC for all , i.e 4 + 4 VC???

and since all design pattern are same so cant i resue same detailsection for all???

A: 

You can reuse tableViewControllers or any viewController for that matter.

If they all share most of the functionality, the best design pattern is add all of the functionality to a single tableVC and then subclass the tableVC for each tab, overriding methods that need to behave differently.

or if all tabs have the same functionality...

Just use the same tableVC controller and pass in the datasource (data array) you want it to display.

so can i use same tableVC for all??

Yes

can i use same detailSection VC for all others?

Yes

Jordan
thanks a lot :-)
prajakta