Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Objective-C Basics (Retired) Advanced Objective-C Memory Management

weak attribute in property states that the reference count is 0. soon aftr creation will property deallocate itself?

since i saw that once the ref count becomes 0 property deallocates the memory.

1 Answer

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

The property will not deallocate itself soon after creation. If there are two properties pointing to same object then the property that will still keep a reference to this object will be the one that is strong. If it is weak then it will be deallocated the same time the object it references is deallocated. This might be confusing at first but it will make more sense when you move on to the iOS development courses.