Re: CALayer, CATextLayer, and inheritance . . .
Re: CALayer, CATextLayer, and inheritance . . .
- Subject: Re: CALayer, CATextLayer, and inheritance . . .
- From: Scott Anguish <email@hidden>
- Date: Sun, 11 Jan 2009 01:47:19 -0500
On 10-Jan-09, at 7:26 PM, Michael A. Crawford wrote:
I know that the documentation states the CALayer entities are to be
allocated with class methods:
CALayer* l = [CALayer layer];
CATextLayer* tl = [CATextLayer layer];
Am I creating a problem by not allocating and initializing my layers
using the class methods?
No. it is perfectly valid to do that. init is the designated
initializer for CALayer. +layer is simply a convenience. The header
shows this, although the doc didn't (until just now -- so next push it
will show the below)
what you are not supposed to do is use initWithLayer:, that's a
special method only used when you create custom presentation layers
for a model layer (i.e. very, very rarely) (see the doc for more
information).
init
Returns an initialized CALayer object.
- (id)init
Return Value
An initialized CALayer object.
Discussion
This is the designated initializer for CALayer.
See Also
• + layer
Declared InCALayer.h_______________________________________________
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