Re: Binding userdefaults update
Re: Binding userdefaults update
- Subject: Re: Binding userdefaults update
- From: Jiva DeVoe <email@hidden>
- Date: Sat, 12 Feb 2005 00:41:29 -0700
I *think* you may find an NSValueTransformer that will convert that
NSArray to an NSMutableArray here:
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html That'd
probably help you.
All praise mmalc. :)
On Feb 11, 2005, at 10:08 PM, Scott Anguish wrote:
On Feb 11, 2005, at 5:11 AM, email@hidden wrote:
thanks for your reply.
however there is something i do not understand.
the binding of the "selected index" DOES work if i change the
popupbutton using the ui. if immutability would be the problem,
shouldn´t the binding refuse to work at all (and shouldn´t there be
an error in the run log)?
ah, sorry, I guess I should have elaborated.
individual values that are returned from user defaults can be
changed, and are written back to the defaults.
but an array is read from defaults as an NSArray, which is
immutable. so you could change the entire array, and write that back
out, but it's not a one step solution with bindings.
there is no error, it just would not recall changes done with
[myPopupbutton selectItemWithTitle:@"atitlestring"],
but recalls changes done by hand fine.
thanks and regards
thomas
On Feb 10, 2005, at 8:47 AM, Scott Anguish wrote:
On Feb 9, 2005, at 8:53 AM, email@hidden wrote:
hi!
i am using an NSArrayController to store the content for
a NSPopupButton. the content of the controller is itself bound
to the shared user defaults.
furthermore the "selectedIndex" property of the popup button is also
bound to the shared user defaults.
everything works fine if i change the selection of the popupbutton
using the user interface.
but when i add another item for my NSPopupButton to the controller
and then
set the selectedItem of the NSPopupButton programatically, this
change is not stored in
the userdefaults.
The data returned by NSUserDefaults is immutable. You can't edit it.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
--
Jiva DeVoe
http://www.devoesquared.com
PowerCard - Intuitive Project Management Software for Mac OSX
_______________________________________________
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