Wednesday, September 11, 2013

Difference between Weak and Strong keywords

Strong means you want to keep control over the lifetime of the object. If an object is marked as strong mean object remains in the heap until you point that object strongly. If you send the object to nil only than it will be collected by the Garbage collection.

Weak means you don't want to keep control over the lifetime of the object. A weak reference does not extend the lifetime of the object it points to, and automatically becomes nil when there are no strong references to the object. If no one is pointing the object strongly than the object will be collected by the heap.


you can find more details about ARC(Automatic Reference Counting) Click Here...




No comments:

Post a Comment