Talk About Network

Google





Mac > Mac Programmer Help > Re: OK, what ha...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 3770 of 3889
Post > Topic >>

Re: OK, what have I missed??? (continuation of my NSTableView question)

by Gregory Weston <uce@[EMAIL PROTECTED] > Jun 12, 2008 at 03:24 PM

In article <2oydneAWac0i9czVnZ2dnUVZ_qLinZ2d@[EMAIL PROTECTED]
>,
 Don Bruder <dakidd@[EMAIL PROTECTED]
> wrote:

> The CocoaDev site that Reinder pointed me at was *VERY* useful - At 
> least now I think I've got the beginnings of a grip on how to use 
> NSTableView.
> 
> Except for one minor detail...
>
> ...
> 
> // This routine appears to never get called.
> // Putting a breakpoint (or several of them) anywhere in it does nothing

> whatsoever. I strongly suspect that this is the reason I'm getting a 
> blank NSTableView displayed, but I don't know where to look for the 
> problem. If it were to execute, it looks like it *SHOULD* do what it's 
> supposed to. But it doesn't seem to get executed, and I don't know why.
> - (id)tableView:(NSTableView *)aTable 
> objectValueForColumn:(NSTableColumn *)aCol row:(int)aRow
> {
>    id              loc_id, loc_dat;
>    NSMutableArray *loc_col;
>    
>    loc_id = [aCol identifier];
>    if (loc_id != nil)
>     {
>       loc_col = [itemList objectForKey:loc_id];
>       if (loc_col != nil)
>        {
>          loc_dat = [loc_col objectAtIndex:aRow];
>        }
>     }
>    return (loc_dat);
> }

The first thing I want to say is this:

A dictionary of arrays is going to be a lot harder to sort than an array 
of dictionaries when/if you decide that's something you want to do.

The second thing - and the actual answer to your problem - is that 
you've named the method incorrectly. I'd be marginally surprised if 
you're not getting a message emitted when you run that says the object 
isn't responding correctly. The method signature is:

- (id)tableView:(NSTableView *)aTableView 
objectValueForTableColumn:(NSTableColumn *)aTableColumn 
row:(NSInteger)rowIndex

Note "objectValueForTableColumn."
                    ^^^^^

G

-- 
"Harry?" Ron's voice was a mere whisper. "Do you smell something ...
burning?"
   - Harry Potter and the Odor of the Phoenix
 




 4 Posts in Topic:
OK, what have I missed??? (continuation of my NSTableView questi
Don Bruder <dakidd@[EM  2008-06-12 11:19:43 
Re: OK, what have I missed??? (continuation of my NSTableView qu
Gregory Weston <uce@[E  2008-06-12 15:24:52 
Re: OK, what have I missed??? (continuation of my NSTableView qu
Don Bruder <dakidd@[EM  2008-06-12 14:44:18 
Re: OK, what have I missed??? (continuation of my NSTableView qu
Gregory Weston <uce@[E  2008-06-13 10:41:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 19:18:10 PST 2009.