Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Weak and Strong Reference

    • 0
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 186
    Comment on it

    Strong- A strong reference means we want to own that object we are referencing with property or variable. Any object assign to this property will not be destroyed as long as it is not assign to strong reference.

    Weak - A weak reference is not for owning a object. Weak object only lives because one other object hold a strong reference property. Once that is not the case our weak property will destroy and will become nil.

    This is the only reason why we have delegate properties as weak to avoid retain cycles and IBOutlets are weak because main controller holds the main view as strong.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: