What is the difference between @property(nonatomic, retain) that we used in Xcode 3.2 and @property(strong, nonatomic) which we use in Xcode 4.2 ? What does "strong" mean here?
1
votes
1 Answers
4
votes
"strong" is a hint to ARC (Automatic Reference Counting) that as long as this property points to an object, that object will not be automatically released.
There is also a "weak" keyword, that instead (in IOS5) indicates that ARC is free to release the object the property points to, as long as it sets the property to NULL at the same time.
In summary, as long as an object has at least one "strong" property pointing to it, it won't be released by ARC, when it doesn't it will be released immediately and all "weak" properties pointing to it are set to NULL.