susitha susitha - 3 months ago 10
iOS Question

NSMutableArray alloc init vs NSMutableArray array

What is the differece between:

[[NSMutableArray alloc] init]


and

[NSMutableArray array]

Answer

Here in [NSMutableArray array] you don't have to release array it will be released automatically. & if you will write [NSMutableArray alloc] init] you will have to release array so [[NSMutableArray array] will be equivalent to [[[NSArray alloc] init] autorelease];

Comments