- Joined
- Oct 7, 2009
- Messages
- 14
- Reaction score
- 0
- Points
- 1
- Location
- Singapore
Code:
-(id) init
{
if (self = [super init])
{
[self autorelease];
return self;
}
}
With all the memory dangers that hides behind the corner and with the knowledge that there are functions that returns autorelease objects like arrayWithCapacity or stringWithFormat, shouldn't it be a good idea to also implement autorelease in our own objects like this code illustrated above for when the pool drains, it will go as well and there is no need to pollute the main codes with layers of
Code:
[object autorelease]