what is the difference between strong and weak property?

ios5, iphone, properties

Solution

`Strong` means that as long as this property points to an object, that object will not be automatically released. In non-ARC it's a synonym for `retain`.

`Weak` instead, means that the object the property points to, is free to release but only if it sets the property to `nil`. In ARC you use weak to ensure you do not own the object it points to.

Problem

As strong and weak properties are new in iOS 5. If any one tell me which property is used when. When we should use strong or when we should use weak? ``` @property(nonatomic,strong) @property(nonatomic,weak) ```

Original source

Related problems