• 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: Why can't I use any object as a key in a dictionary?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why can't I use any object as a key in a dictionary?


  • Subject: Re: Why can't I use any object as a key in a dictionary?
  • From: Charles Jenkins <email@hidden>
  • Date: Mon, 01 Feb 2010 10:35:47 -0500


On 2010-02-01 03:26, Roland King wrote:

By the way, CALayer is a KVC compliant class so you can in fact just store a reference to an arbitrary object in it with


[ layer setValue:value forKey:@"KeyForObjectAssociatedWithLayer" ];

Roland, I'm a noob and I'm not sure I've got a good handle on KVC yet... This statement really looks interesting to me, because it seems to suggest that with a KVC-compliant class, you can make arbitrary linkages by just making up keys. (I checked the documentation, and haven't found any property named objectAssociatedWithLayer, so I'm assuming that you were able to create this key name yourself and name it whatever you liked.) Is this true or have I totally misunderstood you?
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Why can't I use any object as a key in a dictionary?
      • From: Roland King <email@hidden>
    • Re: Why can't I use any object as a key in a dictionary?
      • From: Alexander Spohr <email@hidden>
References: 
 >Why can't I use any object as a key in a dictionary? (From: Rick Mann <email@hidden>)
 >Re: Why can't I use any object as a key in a dictionary? (From: Roland King <email@hidden>)
 >Re: Why can't I use any object as a key in a dictionary? (From: Roland King <email@hidden>)

  • Prev by Date: Re: updating NSView on separate thread
  • Next by Date: Re: NSDocument override Undo's default handling of changes count
  • Previous by thread: Re: Why can't I use any object as a key in a dictionary?
  • Next by thread: Re: Why can't I use any object as a key in a dictionary?
  • Index(es):
    • Date
    • Thread