Thanks Matt!

I actually didn't know there are some classes that still do not support
weak reference in Cocoa. But does that imply that they also do not support
strong reference? If Yes, than I'm totally OK with it and will just use
assign property or __unsafe_unretained ivar.

Perhaps we should add the tags you mention to the classes in GNUstep that
do not support weak references, like Apple has.

Found this: (
https://developer.apple.com/library/mac/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html
)

*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.

--
Johannes Lundberg
BRILLIANTSERVICE CO., LTD.


On Sun, Feb 16, 2014 at 4:20 PM, Matt Rice <ratm...@gmail.com> wrote:

> On Sat, Feb 15, 2014 at 4:17 PM, Lundberg, Johannes
> <johan...@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.
>
> been a long time since i've been in this area, but I do recall
> 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....
>

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
秘密保持について:この電子メールは、名宛人に送信したものであり、秘匿特権の対象となる情報を含んでいます。
もし、名宛人以外の方が受信された場合、このメールの破棄、およびこのメールに関する一切の開示、
複写、配布、その他の利用、または記載内容に基づくいかなる行動もされないようお願い申し上げます。
---
CONFIDENTIALITY NOTE: The information in this email is confidential
and intended solely for the addressee.
Disclosure, copying, distribution or any other action of use of this
email by person other than intended recipient, is prohibited.
If you are not the intended recipient and have received this email in
error, please destroy the original message.
_______________________________________________
Bug-gnustep mailing list
Bug-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to