Re: Creating a class cluster
Re: Creating a class cluster
- Subject: Re: Creating a class cluster
- From: Ondra Cada <email@hidden>
- Date: Mon, 29 Jul 2002 14:21:21 +0200
On Monday, July 29, 2002, at 03:06 , Greg Titus wrote:
An alternative to this is to have your super class be a singleton by
implementing +allocWithZone:.
+ alloc {
static MySuperClass *sharedInstance = nil;
if (!sharedInstance)
sharedInstance = [super alloc];
return sharedInstance;
}
I'd say this is not the best idea, at least not for a relative newbie. How
would you make instances of those hidden subclasses? Directly using
NSAllocateObject, or will you make +myAlloc to be able to reach the
original one?
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.