Lack of Initializers or Factory Methods
Lack of Initializers or Factory Methods
- Subject: Lack of Initializers or Factory Methods
- From: Gordon Apple <email@hidden>
- Date: Mon, 03 Nov 2008 09:53:57 -0600
- Thread-topic: Lack of Initializers or Factory Methods
The following example is one of several I have run into recently.
Inheritance is as follows: CAKeyframeAnimation: CAPropertyAnimation :
CAAnimation. CAKeyframeAnimation has no explicit initializer or factory
method. Dudney's book uses [CAKeyframeAnimation animation] to create an
object. However, CAKeyframeAnimation has no such factory method.
CAAnimation does. Why should I assume that the "animation" factory method
will return an object of class CAKeyframeAnimation instead of CAAnimation
when it is not re-defined in CAKeyframeAnimation.h?
The docs say that CAKeyframeAnimation shoud be created with the
inherited (from CAPropertyAnimation) animationWithKeyPath factory method.
That raises the same issue.
Is there a basic assumption that such factory methods are implicitly
redefined for all subclasses?
_______________________________________________
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