• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Convenience Methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Convenience Methods
      • From: "Adam R. Maxwell" <email@hidden>
References: 
 >RE: Convenience Methods (From: Jeff Laing <email@hidden>)

  • Prev by Date: RE: Convenience Methods
  • Next by Date: Re: Problems loading data into NSTableView using a NSArrayController
  • Previous by thread: RE: Convenience Methods
  • Next by thread: Re: Convenience Methods
  • Index(es):
    • Date
    • Thread