Search code examples
iosdesign-patternsinstanceviewcontrollertabbed

iOS Controller Pattern - same instance through 3 viewcontrollers


i want to use the same instance of a model class e.g. MyClass myclass - in 3 tabs (3 view controllers).

Should i alloc this instance in a rootcontroller ? Or is a simple way to delegate this instance throw 3 tab viewcontroller ?

Thanks

Tobias


Solution

  • You should check how to use singletons.

    More info specific for Apple could be found here.

    If you have some specific questions please post some code and I'm sure me or somebody else from the community will help you.