• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Checkbox, Dictionary, Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Checkbox, Dictionary, Bindings (From: Greg Herlihy <email@hidden>)

  • Prev by Date: Getting WebView and JavaScript to communicate. MFC can do it.
  • Next by Date: Re: Cocoa control in carbon window
  • Previous by thread: Re: Checkbox, Dictionary, Bindings
  • Next by thread: tableview column binding to array index
  • Index(es):
    • Date
    • Thread