Re: Creating a class cluster
Re: Creating a class cluster
- Subject: Re: Creating a class cluster
- From: David Newberry <email@hidden>
- Date: Sun, 28 Jul 2002 17:04:53 -0700
Thanks to all who responded to my question. I've got it pretty much
working, but still am experiencing some oddness... maybe. Just for ease I
took all the code out of my superclass and lived with the "incomplete
implementation" warnings. However, I have to put code like this inthe
superclass:
- (MyClass *)initWithInfo:(id)data
{
return [[MySubClass1 alloc] initWithInfo:data];
}
- (MyClass *)initWithPath:(NSString *)data
{
return [[MySubClass2 alloc] initWithPath:data];
}
If I don't have this code which forwards the messages to the subclasses, I
get errors when sending an init... message to my superclass (eh '[[MyClass
alloc] initWithPath@"/"]'. Is this appropriate? It seems alternatively
that people have said "yes" and "no"... but chances are I just
misunderstood something. Also, from what Ondra said, do I take it that (if
this code is proper), those methods should each start with "[self
autorelease];"?
Thanks,
-David Newberry
_______________________________________________
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.