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

Creating a class cluster


  • Subject: Creating a class cluster
  • From: David Newberry <email@hidden>
  • Date: Fri, 26 Jul 2002 16:57:40 -0700

Hello all,

I would like to create a class cluster. I have looked at the documentation,
but I'm still confused. Since I'm creating the whole cluster (not basing it off anything else), I create the "abstract superclass" as well as its subclasses. It's creating the abstract superclass that's my problem right now (I think). I've created a class to base the subclasses in the cluster off, but I don't think it's "abstract." If it was abstract I assume that I wouldn't have to have any code for it -- I'd assume that all it really needs is a header file. But whatever I'm doing wrong, that's not the case -- it complains if I don't provide the implementation.

The other thing I'm not sure about it creating instances of the class. Consider my public class "DNClass" and its subclasses "DNSubClassOne" and "DNSubClassTwo". If I wasn't using a class cluster, I'd use code something like this to create new instances:
DNClass *var = [[DNClass alloc] initWithString:@"text"];
With a class cluster, though, initWithString: would be defined by one of DNClass' subclasses. Since the subclasses will have different member variables, it seems unlikely that I should be able to do this. Is it correct that I'd have to embed a alloc...: method in each subclass, or is the above code still legal with a class cluster?

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>
  • Prev by Date: Re: [OT] Open Documentation
  • Next by Date: [OT] Case-preserving filesystems (was: Re: FYI: Objective-C++)
  • Previous by thread: Re: [OT] Open Documentation
  • Next by thread: Re: Creating a class cluster
  • Index(es):
    • Date
    • Thread