Re: CALayer defaultValueForKey
Re: CALayer defaultValueForKey
- Subject: Re: CALayer defaultValueForKey
- From: Gordon Apple <email@hidden>
- Date: Wed, 18 Feb 2009 17:28:59 -0600
- Thread-topic: CALayer defaultValueForKey
I guess that should have been obvious that a "value" object would be
returned a la dictionaries. The "discussion" part actually confused rather
than enlightened me.
Although the properties individually state the defaults, I still haven't
found the addendum chapter you mentioned and I just updated my docs to the
Feb. disk. Am I just missing it somewhere?
It sure would be nice to have those CG Geometry values included in Cocoa
and not just in iPhone. CGColorRef to/from NSColor would be good also. (I
wrote my own for archiving a set of properties.)
On 2/17/09 1:59 PM, "Scott Anguish" <email@hidden> wrote:
>
> On 15-Feb-09, at 6:07 PM, Gordon Apple wrote:
>
>> The docs are a clear a mud on this. What do you get from CALayer's
>> defaultValueForKey? Is this the same as one would expect from
>> valueForKey
>> for an NSDictionary? The return type is "id".
>>
>> " If this method returns nil a suitable ³zero² default value for the
>> property is provided, based on the declared type of the key. For
>> example, if
>> key is a CGSize object, a size of (0.0,0.0) is returned. For a
>> CGRect an
>> empty rectangle is returned. For CGAffineTransform and
>> CATransform3D, the
>> appropriate identity matrix is returned."
>>
>> What does that mean? If you want a CGSize, does that mean you
>> have to
>> use "sizeValue" on what is returned and convert it? Or
>> "CGSizeValue"? But
>> wait, that's an iPhone SDK extension. Why isn't that in Cocoa?
>>
>
> Read the Core animation Programming Guide section on key-value coding
> extensions, it describes the wrapping for defaultValueForKey: and
> other similar methods.
>
> also, there is an additional addendum like chapter that explains the
> default values for all the properties.
>
>
G. Apple
_______________________________________________
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