Simple question driving me CRAZY

  • I have a subclass of a NSViewController.  In fact, I created on just as a test with no custom code.  I then throw an NSTextView in the NSView that comes with it and then drag from the NSTextView to the .h file to create an outlet.  Why why why is it making it unsafe_unretained?  I'm using ARC.  Why it's it weak like every other subview?  The NSTextView is in a NSScrollView which is in the controllers NSView.  The NSScrollView is coming in as weak.

    It's been diving me insane all day.

    Thanks
  • From http://developer.apple.com/library/mac/releasenotes/ObjectiveC/RN-Transitio
    ningToARC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011226-CH1
    -SW17
    :

    > Which classes don’t support weak references?
    > You cannot currently create weak references to instances of the following classes:
    > NSATSTypesetter, NSColorSpace, NSFont, NSFontManager, NSFontPanel, NSImage, NSMenuView, NSParagraphStyle, NSSimpleHorizontalTypesetter, NSTableCellView,NSTextView, NSViewController, NSWindow, and NSWindowController. In addition, in OS X 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.

    HTH,

    Dave

    On Jun 16, 2012, at 2:06 PM, Brad Stone wrote:

    > I have a subclass of a NSViewController.  In fact, I created on just as a test with no custom code.  I then throw an NSTextView in the NSView that comes with it and then drag from the NSTextView to the .h file to create an outlet.  Why why why is it making it unsafe_unretained?  I'm using ARC.  Why it's it weak like every other subview?  The NSTextView is in a NSScrollView which is in the controllers NSView.  The NSScrollView is coming in as weak.
    >
    >
    > It's been diving me insane all day.
    >
    > Thanks
previous month june 2012 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
Go to today