Created
January 4, 2013 15:28
-
-
Save anonymous/4453451 to your computer and use it in GitHub Desktop.
Apple's weak @Property example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The following declaration is similar to "@property(assign) MyClass *myObject;" | |
// except that if the MyClass instance is deallocated, | |
// the property value is set to nil instead of remaining as a dangling pointer. | |
@property(weak) MyClass *myObject; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's simple
NSObject
category that can be used to debug it http://www.componentix.com/blog/28/debug-usage-of-objectivec-weak-properties-with-kvo