small medium large xlarge

Generic-user-small
29 Jun 2010, 12:14
Raoul Callaghan (2 posts)

Hi,

Am loving Beginning Mac Programming and I’ve encountered my first “stuck”.

I’ve looked at the errata link and did not see anything pertaining to the following, so as expected, I’m in error somewhere.

From page 154, 8.4 A new Application, I’m working my way through this section up to top of page 170 where it says to Build & Run the application. At this point, I don’t see any contents of the array (Milk, Eggs, Butter).

looking at the debugger console, I see: Running… 2010-06-29 22:09:25.175 Shopping List[55271:a0f] *** Illegal NSTableView data source (<MyDocument: 0x10043b850>). Must implement numberOfRowsInTableView: and tableView:objectValueForTableColumn:row:

But I’m not knowledgable enough to see where my error lies.

My Xcode project from page 154 up to page 170 is here: http://files.me.com/tangles/c1eahl if anyone is kind enough to help me out.

Thank you,

Raoul.

using text: ISBN-10: 1-934356-51-4 ISBN-13: 978-1-934356-51-7 P1.0 printing, March 2010 Version 2010-2-16

Generic-user-small
29 Jun 2010, 12:55
Tim Isted (105 posts)

Hi Raoul,

You have a typo in the name of the method that the debugger console is complaining about: the @numberOfRowsInTalbeView:@ method should be @numberOfRowsInTableView:@ (this is in @MyDocument.m@)

As far as the table view is concerned, it’s looking for its data source object to respond to the @numberOfRowsInTableView:@ method. Even the tiniest of typos are enough to mean that the data source won’t “see” the method, and so will complain that you haven’t implemented it.

This is the only change I had to make to populate the table view.

Thanks, Tim

Generic-user-small
30 Jun 2010, 01:07
Raoul Callaghan (2 posts)

ah ha!

hehe, you don’t wanna how long I trawled through the code looking for such a straightforward error.

Many thanx Tim.

Raoul.

You must be logged in to comment