How could I create the following array without having memory leaks:
It should be an array with arrays inside
arr = [[NSMutableArray alloc] initWithObjects:
[[NSMutableArray alloc] init],
[[NSMutableArray alloc] init],
[[NSMutableArray alloc] init],
[[NSMutableArray alloc] init],
[[NSMutableArray alloc] init],
[[NSMutableArray alloc] init],
[[NSMutableArray alloc] init], nil];
+(id)arrayWithCapacity:(NSUInteger)numItems?[NSMutableArray array]rather than your alloc/init approach.