Reputation: 2472
Without automatic reference counting you often write code like this, when adding a new class:
assuming the classname is "Foo"
+ (id) foo
{
return [[[self alloc] init] autorelease];
}
- (id) init
{
self = [super init];
// do some initialization here
return self;
}
Well, how are you supposed, to write this for arc? Just like the code below?
+ (id) foo
{
return [[self alloc] init];
}
- (id) init
{
self = [super init];
// do some initialization here
return self;
}
Upvotes: 3
Views: 1314