Objective-C ARC: strong vs retain and weak vs assign

strong is the same as retain in a property declaration so for ARC projects use strong instead of retain.

Use assign for C primitive properties and weak for weak references to Objective-C objects.


and more here: http://developer.apple.com/library/ios/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html

However, note that assign is the default. So, for an int you would use:

@property (nonatomic) int value; // assign by default


Leave a Reply

Your email address will not be published. Required fields are marked *