|
From: | Lundberg, Johannes |
Subject: | Re: Segfault when NSTextView is released |
Date: | Sun, 16 Feb 2014 16:44:44 +0900 |
Which classes don’t support weak references?
You cannot currently create weak references to instances of the following classes:
NSATSTypesetter
, NSColorSpace
, NSFont
, NSMenuView
, NSParagraphStyle
, NSSimpleHorizontalTypesetter
, and NSTextView
.
Note: In addition, in OS X v10.7, you cannot create weak references to instances of NSFontManager
, NSFontPanel
, NSImage
, NSTableCellView
, NSViewController
, NSWindow
, and NSWindowController
. In addition, in OS X v10.7 no classes in the AV Foundation framework support weak references.
For declared properties, you should use assign
instead of weak
; for variables you should use __unsafe_unretained
instead of __weak
.
In addition, you cannot create weak references from instances of NSHashTable
, NSMapTable
, or NSPointerArray
under ARC.
On Sat, Feb 15, 2014 at 4:17 PM, Lundberg, Johannesbeen a long time since i've been in this area, but I do recall
<johannes@brilliantservice.co.jp> wrote:
> I don't know if the problem is because my ivar. This should work regardless
> if I store the pointer in an ivar or not. And so far this only occurs on
> NSTextView. I suspect that the way NSTextView releases its objects
> internally is not ARC-friendly.
NSTextView being rather weird due to its support for multiple
ownership graphs, I can definitely see as being non-arc friendly...
looking in our NSTextView.h I didn't see the objc_arc_weak_unavailable
or NS_AUTOMATED_REFCOUNT_WEAK_UNAVAILABLE or a -supportsWeakPointers
which the following indicates should be there
http://stackoverflow.com/questions/12882710/iboutlet-for-nstextview-in-a-arc-project
possibly has something to do with it....
[Prev in Thread] | Current Thread | [Next in Thread] |