Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why cannot NSTextView for a weak reference?

I noticed than in OSX, the NSTextView cannot for a weak refference (if you try to link it weak, you will get)

Cannot form weak reference to instance (0x600000122da0) of class NSTextView. It is possible that this object was over-released, or is in the process of deallocation.

also the outlet from XCode is created as assign by default

Why there cannot be a weak reference? What can be the reason?

like image 692
Peter Lapisu Avatar asked Feb 12 '16 11:02

Peter Lapisu


1 Answers

Check FAQ here Transitioning to ARC Release Notes:

Q:Which classes don’t support weak references?

A:You cannot currently create weak references to instances of the following classes: NSATSTypesetter, NSColorSpace, NSFont, NSMenuView, NSParagraphStyle, NSSimpleHorizontalTypesetter, and NSTextView.

etc.

like image 61
alexkod Avatar answered Sep 17 '22 17:09

alexkod