Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manually implementing @property

When manually implementing @property instead of using @synthesize, do you have to include ARC code?

Would it be ok to implement it like this:

@synthesize var1;

- (void)setvar1:(NSObject *)newVar1
{
    var1 = newVar1;
}

or do you have to include retain, release etc?

like image 336
Stas Jaro Avatar asked May 14 '26 07:05

Stas Jaro


1 Answers

Under ARC, you don't have to (and in fact cannot) manually retain or release variables. Your implementation, apart from needing a capital V in setVar1:, is perfectly acceptable under ARC.

like image 93
Tim Avatar answered May 16 '26 21:05

Tim