Re: Why can't I use any object as a key in a dictionary?
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