07 Nov 2010, 12:35

Simon Wragg (4 posts)

after build and go (xcode 3.1) error at start of MyDoc’M not finding protacol dec’s for NSTableViewDelegate and NS….DataSource

07 Nov 2010, 13:33

Tim Isted (105 posts)

Hi Simon,

(Page numbers below are from the first printing P1.0 of the paper book, as I think that’s what you are using?)

This is because the @NSTableViewDelegate@ protocol isn’t included in the Mac OS X SDK included with Xcode 3.1.

You’ll likely run into several of these missing protocol errors throughout the course of the book. These errors are easy to fix; you just need to remove the offending protocol declaration from the relevant interface file.

For page 320, this means changing this:

@interface MyDocument : NSDocument <NSTableViewDelegate, NSTableViewDataSource>

back to this:

@interface MyDocument : NSDocument

(i.e., how it was before the modifications described on page 320!)

You’re probably also going to run into a problem on page 325: the @reloadDataForRowIndexes:columnIndexes:@ method won’t be available to you (it was only introduced for Mac OS X 10.6). The application will still work, but you’ll experience some strange behavior when you try to mark an item as purchased, and see messages logged to the Xcode console about unrecognized selectors (which is the term used when a message is received by an object that doesn’t know how to handle that message).

The easiest way to avoid this is just to leave the original behavior of reloading the entire table view using @reloadData@ (i.e., the code shown on page 323).

If you run into anything else, please let me know!

  You must be logged in to comment