Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Chapter 5 Ctrl-drag discrepancy

On page 103 of the Preview version ctrl-drag from the text field to the header file produces

@property (unsafe_unretained) IBOutlet NSTextView *notesView;

instead of what's in the text.

A Google search on the type produces only explanations of this on iOS 4 not on OS/X.

XCode 4.6.1, OS/X 10.8.3

Comments

  • Most of the time, if you create a property that is an object pointer, you should either use strong or weak. If it's an IBOutlet to anything other than a top-level object in the nib file, you should typically use weak. However, there are a few classes that do their own peculiar form of memory management, and NSTextView is one of those. In those cases, weak is not allowed, and the tools are smart enough to defautl to unsafe_unretained instead. Unfortunately the tools aren't smart enough to properly explain this anomaly!
Sign In or Register to comment.