Hi all,
I my iPhone app, i am i am having a static object "staticCatalogObj" implemented as follows....
I am calling this method in many view controllers to get the same object.
What all things i want to implement / and the necessary releasing statements i want to add to this part??
In many view controllers i have, i am getting this object by
Is this enough from memory point of view???
I my iPhone app, i am i am having a static object "staticCatalogObj" implemented as follows....
Code:
+(Catalog *)getCatalogObject
{
if(staticCatalogObj == nil)
{
staticCatalogObj = [[Catalog alloc]init];
staticCatalogObj.catalogDictionary = [[NSMutableDictionary alloc] init];
staticCatalogObj.itemsArray = [[NSMutableArray alloc]init];
}
return staticCatalogObj;
}
I am calling this method in many view controllers to get the same object.
What all things i want to implement / and the necessary releasing statements i want to add to this part??
In many view controllers i have, i am getting this object by
Code:
Catalog localInstanceOfCatalog = [Catalog getCatalogInstance];
// modify the catalog localObject as per requirement...
[localInstanceOfCatalog release];
Is this enough from memory point of view???