On Fri, Jan 9, 2009 at 8:40 PM, Graham Cox <graham....@bigpond.com> wrote:
> Isn't guaranteed by the semantics of inheritance? I've specified the class:
> [NSMutableArray ... and what I want it to give me... array]; And the fact
> that NSMutableArray inherits NSArray ensures that anything that array can
> do, NSMutableArray can do.

No, it means that NSMutableArray responds to everything NSArray
responds to; there's no semantic guarantee.  What if the subclass
needs a different designated initializer, maybe one with more
arguments?  It would make sense for it to override the superclass's
designated initializer to throw an exception.  But without overriding
the convenience constructor, this will blow up.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to