Cocoa Bindings and Radio Buttons don't save state correctly?
Cocoa Bindings and Radio Buttons don't save state correctly?
- Subject: Cocoa Bindings and Radio Buttons don't save state correctly?
- From: Tod Cunningham <email@hidden>
- Date: Sat, 20 Mar 2004 02:16:58 -0500
I bind each radio button in a button matrix to the "Shared Defaults"
object and get interesting behavior. Each radio button is bound to a
different key in the Shared Defaults dictionary. However, when the
data is written to the plist the value for the radio button is never
FALSE. As you click each button it will set its value to true in the
plist and when you go the the next it won't set the previous button to
false. My guess is this is due to they way Cocoa implements matrix
controls by sharing the same instance of the underlying control.
I was able to workaround this issue, but I had to set the selectedTag
bindings of the Matrix control to save and restore the tag. This still
didn't work exactly right as when there is nothing selected (NIL or
No-Selection options) I supplied a default value of 0 (the tag of my
1st item in the list) which seems not to get applied. Also, I can't
bind other controls to the state of the selected radio button.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.