Re: [workaround/giving up] NSMutableArray of strings bound to NSTokenField does not update after paste
Re: [workaround/giving up] NSMutableArray of strings bound to NSTokenField does not update after paste
- Subject: Re: [workaround/giving up] NSMutableArray of strings bound to NSTokenField does not update after paste
- From: Rick Hoge <email@hidden>
- Date: Fri, 12 Jan 2007 15:23:56 -0500
I have an NSTokenField object that is bound to an NSMutableArray
of NSStrings. If I type text into the field, the newly entered
text is tokenized at the end of editing (i.e. hitting tab) and the
array is updated with the new string added to the array at the
correct index (the setMyArray accessor is called).
If, however, I *paste* the same text into the NSTokenField, the
array is not updated. Does anyone have an idea how this might be
remedied?
Well I'm giving up on getting bound instance variables to update when
a token is pasted by drag and drop into an NSTokenField.
It occurred to me that, since the token field is often used to
compose a list of tokens prior to some kind of "commit" event (like
sending an email or accepting a configuration in a sheet) the easiest
thing is just to grab the desired token composition as the
objectValue from the control in the IBAction that dismisses the sheet
containing the NSTokenField (since in my case there is a sheet). The
-objectValue method always seems to return the complete, correct
contents that you actually see in the token field when it's called
(even though bound instance variables may not have been updated).
I've just been so spoiled with bindings that it's kind of painful to
have to resort to this... and if you really needed to keep an
instance variable in sync with the token field contents this would be
a real hassle...
Rick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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