Re: Checkbox, Dictionary, Bindings
Re: Checkbox, Dictionary, Bindings
- Subject: Re: Checkbox, Dictionary, Bindings
- From: Chris Outwin <email@hidden>
- Date: Tue, 10 Jan 2006 16:35:47 -0600
Hi, Greg
Thank you for your reply.
The NSNumber associated with the checkbox is a value in a
NSDictionary. If I create a new NSNumber, doesn't that mean I need
to also create a new dictionary, as NSDictionary is also immutable?
I was trying to reduce the number of KVC accessor methods by using a
dictionary, like Scott Stevenson does in his MailDemo tutorial.
http://cocoadevcentral.com/articles/000080.php
Even if I use a NSMutableDictionary to contain the NSNumber, having
to create a new NSNumber each time seems to negate the advantages
that key/value coding offers.
Thanks again.
NSNumbers may be immutable, but they are not irreplaceable.
To check or uncheck the checkbox simply replace the NSNumber currently
representing its checked state with a different NSNumber whose value
represents the checkbox's updated state.
_______________________________________________
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