Re: Convenience Methods
Re: Convenience Methods
- Subject: Re: Convenience Methods
- From: Nick Zitzmann <email@hidden>
- Date: Tue, 25 Sep 2007 20:15:11 -0600
On Sep 25, 2007, at 8:10 PM, Jeff Laing wrote:
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.
But class clusters are an implementation detail, and the code
shouldn't care. What's important is +[NSMutableString
stringWithString:] returns an NSMutableString, and +[NSString
stringWithString:] returns an NSString, despite the fact that
+stringWithString: is only defined by NSString.
I know they both really return an NSCFString, but again, it's an
implementation detail.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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