i need clarification for memory management concepts.
i declare one variable in .h
@interface RootViewController : UIViewController
{
NSMutableArray *objMutableArray;
}
@property (nonatomic,retain) NSMutableArray *objMutableArray;
in .m file
@implementation RootViewController
@synthesize objMutableArray=_objMutableArray;
- (void)viewDidload
{
[super viewDidload];
self.objMutableArray=[[NSMutableArray alloc]init];
[self.objMutableArray addObject:@"FirstRow"];
[self.objMutableArray addObject:@"SecondRow"];
[self.objMutableArray addObject:@"ThirdRow"];
[self.objMutableArray addObject:@"FourthRow"];
[self.objMutableArray addObject:@"FifthRow"];
}
i used self.objMutableArray all places. but when i release memory for that instance i used _objMutableArray.
- (void)dealloc
{
[_objMutableArray release];
[super dealloc];
}
actually i confused when i release memory for that instance. please tell me i did correct or i must release "objMutableArray" object.