Re: NSCell subclass editing
Re: NSCell subclass editing
- Subject: Re: NSCell subclass editing
- From: tiennou <email@hidden>
- Date: Tue, 2 Oct 2007 21:43:45 +0200
Le 2 oct. 07 à 20:26, Oliver Quas a écrit :
Hi there,
AFAIK, what you're trying to achieve is not 'in cell editing' but
simple button pressing, so your cell acts more like a NSButtonCell,
right? So why not use the target/action mechanism to inform the
controller object (which probably is also the dataSource for your
tableView)? The controller would then handle the open panel (as its
delegate) and write the returned value into your model object. You
could get the appropriate position of the model object (in your
dataSource's array) by determining the 'calling' cell's row (i.e.
use something like [myTableView selectedRow]). After that, simply
update the table view by sending [tableView reloadData]. If
everything is properly implemented, the tableView should display
the new value in the specific row. IMHO, this should conform better
to the MVC paradigm, does it?
Just my 2 cents.
Hmm, yes I think I'll go with this approach instead. It just felt
that my custom cell was a better place to manage it's data ;-).
Actually it seems like non-text NSCell can't easily be customized to
support another editor (I mean I won't get my updated data by the
delegate method)... Guess I'll file a bug requesting an API allowing
to use something else than NSText for editing ;-)
Thanks for you suggestions all !
Etienne Samson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden