On Mar 24, 2013, at 14:50 , Pax <45rpmli...@googlemail.com> wrote:

You may be more successful if you use a view-based table rather than a 
cell-based table. One of the reasons we have view-based tables is to be able to 
avoid dealing with cells directly, in situations like this.

However, if you've never used a view-based table before, the learning curve is 
fairly steep (though short).

> As to your second question, I've connected the "selector" connection from the 
> cell to 'cellPreferenceChanged'.  In my header I have:
>     IBOutlet NSPopUpButtonCell* preferenceCell;
>     - (IBAction)cellPreferenceChanged:(id)sender;
> and both are hooked up in IB.

Ugh, it doesn't look right to set up an outlet to a cell like this. Table views 
deal with cells at two points:

1. When obtaining a cell for a given column. It uses the delegate method 
'tableView:dataCellForTableColumn:row:' to get the cell, which may or may not 
be the one that's in the nib file. It does a certain amount of configuration of 
the cell after this method returns.

2. When preparing the cell for a drawing specific row. It uses the delegate 
method 'tableView:willDisplayCell:forTableColumn:row:', and does more 
configuration before this method is called.

So, rather than keeping an outlet to a cell that might not be the one used in 
any given case, you should use one of the above delegate methods to find out 
which cell is actually being used.

That's if you need to know the cell in your code, which is doubtful.

> As to the third, how do I find out?

In Xcode, set a breakpoint in the action method. When you get to the 
breakpoint, go to the debugger console and type the "bt" command. That will 
give a backtrace you can copy and paste into an email.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to