Re: Class clusters - infinite loop?
Re: Class clusters - infinite loop?
- Subject: Re: Class clusters - infinite loop?
- From: Ondra Cada <email@hidden>
- Date: Mon, 27 Jun 2005 11:05:31 +0200
Wade,
On 27.6.2005, at 10:50, Wade Tregaskis wrote:
I can't find a single reference to the word "cluster" in any of the
Foundation documentation*.
Ahem... just tried to check NSArray docs; the very beginning (well,
2nd paragraph) of Class Description says pretty explicitly
"NSArray and NSMutableArray are part of a class cluster, so arrays
are not actual instances of the NSArray or NSMutableArray classes but
of one of their private subclasses. Although an array’s class is
private, its interface is public, as declared by these abstract
superclasses, NSArray and NSMutableArray."
To be more specific, if I pick any typical class cluster like the
NS collections, there is no instruction as to which initialiser(s)
return self, which return a new instance, etc.
Go on: there is a specific chapter "Subclassing Notes", which, among
many other interesting details, say
"You might want to implement an initializer for your subclass that is
suited to the backing store that the subclass is managing. The
NSArray class does not have a designated initializer, so your
initializer need only invoke the init method of super. ... Remember
that NSArray is the public interface for a class cluster and what
this entails for your subclass. The primitive methods of NSArray do
not include any designated initializers. This means that you must
provide the storage for your subclass and implement the primitive
methods that directly act on that storage."
I do agree the documentation is not perfect, but to be frank, I don't
see the slightest problem here?
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden