• 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: Creating a class cluster
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Creating a class cluster
      • From: Ondra Cada <email@hidden>
    • Re: Creating a class cluster
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: cocoa-dev digest, Vol 2 #1010 - 13 msgs
  • Next by Date: Re: Serial number verification / obfuscation (was: Re: Hiding
  • Previous by thread: Re: Creating a class cluster
  • Next by thread: Re: Creating a class cluster
  • Index(es):
    • Date
    • Thread