Take for example NSMutableArray:
NSMutableArray* a1 = [[NSMutableArray alloc] initWithCapacity:10];
NSMutableArray* a2 = [NSMutableArray arrayWithCapacity:10];
Under manual reference counting, the second line returned an autoreleased object. Now with ARC enabled, does the second return an __autoreleasing object and the other does not? What's the difference, if any?
What if the class I'm initializing is a custom class which has been converted to ARC, where the conversion removed the autorelease message from the initializer:
MyClass b1 = [[MyClass alloc] initWithNumber:1];
MyClass b2 = [MyClass myClassWithNumber:1];
// MyClass implementation of myClassWithNumber
+(id) myClassWithNumber:(int)num
{
return [[self alloc] initWithNumber:num];
}
Is there any difference between b1 and b2, and is it any different from how a1 and a2 are created?