Great! Yes, this helps immensely. Thank you very much!

It didn’t occur to me that it is possible to mix the bindings and data source 
approaches.

In order not to waste more time and get my job done, I took resort to a double 
click method copying the data to be edited to an NSTextField, whose action 
methods feeds the edited value back into the data source. Works very nicely and 
fits my bill even better than inline editing.

Still, your proof of concept is extremely useful!

Am 08.01.2014 um 01:01 schrieb Willeke <willeke2...@gmail.com>:

> 
> Op 7 jan 2014, om 16:52 heeft Peter het volgende geschreven:
> 
>> I’d actually prefer to use bindings, but my first column should simply 
>> display the row numbers
> 
> After some experimenting I managed to create a simple editable view based 
> table view with row numbers, using bindings except for the row number. The 
> row number is in a column with identifier "RowNumber". I implemented this 
> delegate method:
> 
> - (NSView *)tableView:(NSTableView *)tableView
>   viewForTableColumn:(NSTableColumn *)tableColumn
>                  row:(NSInteger)row
> {
>       NSTableCellView *result = [tableView 
> makeViewWithIdentifier:[tableColumn identifier] owner:self];
>       if ([[tableColumn identifier] isEqualToString:@"RowNumber"])
>               result.textField.objectValue = [NSNumber numberWithInteger:row];
>       return result;
> }
> 
> That's all.
> This is the first time I used a view based table view and it looks too simple 
> but maybe it helps.
> 
> Willeke
> _______________________________________________
> 
> 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/magnard%40web.de
> 
> This email sent to magn...@web.de


_______________________________________________

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