I don’t know assembler well enough to understand so complicated code as Assembly for whole project, but I noticed that if I put strong attribute to the property, a _objc_storeStrong call shows up near the line in my setter where I change my properly;
@interface ClassName : NSObject
@property (strong, nonatomic) NSSet *mySet;
@end
@implementation ClassName
@synthesize mySet;
-(void)setMySet:(NSSet *)newMySet
{
mySet = newMySet;
//do stuff
}
@end
So? am I right? Do the ARC compiler automatically determines whether to retain or assign in overridden class depending on property attributes?
In short, yes. Because you set the property as
strong, it will be retained by the object. If you declare the property asweak, the implied (synthesized) variable is__weak NSSet *mySetand that won’t retain the object, but it will be a auto-zeroing pointer.