I have a property that looks like this:
@property (weak, nonatomic) id<NavigationControllerDelegate> delegate;
But when I run my app I get the following error:
objc[4251]: cannot form weak reference to instance (0x101e0d4b0) of class TabBarController
The only reason I can get from google for this error is that you get it when you try to form a weak reference to an object that overrides retain/release/dealloc, which I am not. My TabBarController is inheriting from NSViewController.
Anyone knows what might cause this? It works if I use "assign", but obviously I'd prefer to use "weak".
According to Apple's Transitioning to ARC Release Notes,
You cannot currently create weak references to instances of the following classes:
NSATSTypesetter
,NSColorSpace
,NSFont
,NSMenuView
,NSParagraphStyle
,NSSimpleHorizontalTypesetter
, andNSTextView
.Note: In addition, in OS X v10.7, you cannot create weak references to instances of
NSFontManager
,NSFontPanel
,NSImage
,NSTableCellView
,NSViewController
,NSWindow
, andNSWindowController
. In addition, in OS X v10.7 no classes in the AV Foundation framework support weak references.
(Note: one needs to be very careful with nonzeroing weak references...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With