RE: Convenience Methods
RE: Convenience Methods
- Subject: RE: Convenience Methods
- From: Jeff Laing <email@hidden>
- Date: Wed, 26 Sep 2007 12:10:04 +1000
> On Sep 25, 2007, at 7:46 PM, Jeff Laing wrote:
>
> > Sorry, I don't understand this.
> >
> > There is no way the class method is going to return subclasses.
>
> Really? Don't tell that to whoever designed NSString (for example)
> and its subclasses. Because they return id and not a specific
You are confusing the issue.
The original posters convenience method is not going to return subclasses,
so when he asks about what type to return, suggestions should be applicable
to his code.
NSString's convenience methods are hiding class clusters, and I stand by the
assertion that every one of them returns a valid NSString object. They may
be subclasses of NSString but that does not make them non-NSString objects.
Inheritance 101.
_______________________________________________
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