• 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: setValue vs setObject (NSMutableDictionary)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setValue vs setObject (NSMutableDictionary)


  • Subject: Re: setValue vs setObject (NSMutableDictionary)
  • From: Sherm Pendley <email@hidden>
  • Date: Sun, 17 Apr 2005 18:06:45 -0400

On Apr 17, 2005, at 5:28 PM, Mark Dawson wrote:

I just wanted to double check the usage of setValue (and valueForKey) vs setObject.  In example code, I see interchangeable usage…

(1) setValue is only in 10.3 & above

(2)  Are the below two statements are equivalent (i.e., setValue can handle floats, ints, etc directly, while setObject must go through NSNumber)

[dict setValue:1.0 forKey:@"someFloatKey"]

Why would you expect that to work? -setValue:forKey: is clearly documented as taking an id for value.

The difference is that setValue is KVC compliant, whereas setObject was not.

sherm--



Cocoa programming in Perl: http://camelbones.sourceforge.net

Hire me! My resume: http://www.dot-app.org


 _______________________________________________
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

  • Follow-Ups:
    • Re: setValue vs setObject (NSMutableDictionary)
      • From: Mark Dawson <email@hidden>
References: 
 >setValue vs setObject (NSMutableDictionary) (From: Mark Dawson <email@hidden>)

  • Prev by Date: Displaying an AWT Image on an NSButton
  • Next by Date: Date / time localisation
  • Previous by thread: setValue vs setObject (NSMutableDictionary)
  • Next by thread: Re: setValue vs setObject (NSMutableDictionary)
  • Index(es):
    • Date
    • Thread