Re: Saving the text selection with master/detail view and bindings
Re: Saving the text selection with master/detail view and bindings
- Subject: Re: Saving the text selection with master/detail view and bindings
- From: Camillo Lugaresi <email@hidden>
- Date: Sat, 7 Jan 2006 22:09:42 +0100
On 07/gen/06, at 21:39, Adam Knight wrote:
I have a master/detail view with an NSTextView as one of the detail
items. As the item is changed I'd like to retain the selected text
and cursor position in the text view.
When the selected item is changed I can successfully save the
selection with selectedRanges called from textDidEndEditing. I
can't, however, seem to find a way to find out when bindings has
finished changing the NSTextView's content so that I can set the
selected ranges for the next item.
I've tried:
* KVO on the NSArrayController's selectionIndexes property
(triggers before the change is finished)
* textDidBeginEditing (doesn't trigger until I click in the text view)
So how can I tell when bindings has finished updating the
NSTextView so that I can set the selected ranges again? What
triggers _after_ the change? Should I just do the hackish thing
and do a delayed action after the KVO triggers (yuck)?
If the master view is an NSTableView, you could try using the
tableViewSelectionDidChange: delegate method.
Camillo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden