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
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
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.
Assuming your Tab Bar View Controller is the app's initial view controller, you're probably best off with instantiating the Model Object in your App Delegate and then passing it off to each view controller managed by the Tab Bar View Controller.