Skip navigation.
 
mlRe: Apple's excellent documentation on class clusters
FROM : Craig S. Cottingham
DATE : Wed Jan 02 23:03:54 2002

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday, January 2, 2002, at 03:56 , Erik M. Buck wrote:

> ----- Original Message -----
> From: "Craig S. Cottingham" <<email_removed>>
> [Deleted]

>> IOW, using the MonthArray
>> example from the document, how should I create instances of
>> MonthArray in the same transparent way as other NSArray
>> instances? I can take a guess at how it should be done, but I'd
>> rather the documentation state how explicitly.

>
> There are two answers.
>
> First, the particular initializer in the cluster's abstract cover class
> usually determines which private subclass is actually instantiated.
> NSString's -initWithCString: and -initWithString: methods probably use
> different private subclasses of NSString in their
> implementation.  After
> creating a subclass of a class cluster as was done in the MonthArray
> example, and additional initializer such as -initWithMonths can
> be added to
> the NSString class using a category.


That was my guess.

> The -initWithMonths initializer
> creates an instance of MonthString.  In that way, the existence of the
> MonthString class can be "hidden" to the same extent other
> subclasses of
> NSString are hidden.


See? While Apple's documentation on this topic is very good, you
managed to improve on it.

- --
Craig S. Cottingham
<email_removed>
PGP key available from:
<http://pgp.ai.mit.edu:11371/pks/lookup?op=get&search=0xA2FFBE41>
ID=0xA2FFBE41, fingerprint=6AA8 2E28 2404 8A95 B8FC 7EFC 136F
0CEF A2FF BE41
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (Darwin)
Comment: For info see http://www.gnupg.org

iD8DBQE8M4PPE28M76L/vkERAiveAJ9o9Gpo/73Ft0fjJDbT52mem8A3VQCeNTsT
GfJIKefxJt7/UwoZScbQppU=
=WWXL
-----END PGP SIGNATURE-----


Related mailsAuthorDate
mlApple's excellent documentation on class clusters Erik M. Buck Jan 2, 22:00
mlRe: Apple's excellent documentation on class clusters Craig S. Cottingha… Jan 2, 22:19
mlRe: Apple's excellent documentation on class clusters Erik M. Buck Jan 2, 22:56
mlRe: Apple's excellent documentation on class clusters Craig S. Cottingha… Jan 2, 23:03
mlRe: Apple's excellent documentation on class clusters jgo Jan 3, 07:55
mlRe: Apple's excellent documentation on class clusters Bill Cheeseman Jan 3, 16:38