As you read here in most cases a IBOutlet
should be weak.
Now as you can read in the development library not all classes support weak references. (e.g. NSTextView). This means you have to use assign:
@property (assign) IBOutlet NSTextView *textView;
If you use a weak reference you will get the following error: "Synthesis of a weak-unavailable property is disallowed because it requires synthesis of an ivar of the __weak object"
What the documentation missed to mention is now you have to set the property again to nil after it's usage e.g. by a dealloc
method:
- (void)dealloc
{
self.textView = nil;
}
As far as I understood classes marked with NS_AUTOMATED_REFCOUNT_WEAK_UNAVAILABLE
don't support weak references but what is the reason?