Hi all,
I have the following 2 code snippets. Assume I have a Parent class and in Parent.h class I have
@property (retain) NSMutableArray *childrens;
and I have synthesize it in the .m file correctly. assume in Parent.m file
-(void) dealloc
{
[childrens release];
[super dealloc];
}
In another class I declare like this.
1.
Parent *p = [[Parent alloc] init];
p.chidlrens = [[NSMutableArray alloc] init];
// do some other stuff
2.
Parent *p = [[Parent alloc] init];
NSMutableArray *childArray = [[NSMutableArray alloc] init];
p.childrens = childArray;
[childArray release];
From above 2 methods is there a leak in method 1?