• 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: Abstract classes and methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Abstract classes and methods


  • Subject: Re: Abstract classes and methods
  • From: Ondra Cada <email@hidden>
  • Date: Wed, 29 Aug 2001 16:29:29 +0200

Karl,

>>>>>> Karl Goiser (KG) wrote at Wed, 29 Aug 2001 23:53:02 +1000:
KG> The question, then, should be (as you were saying) "How do I stop
KG> anybody from instantiating a particular class?"

Actually, the question is "why would I want that"?

KG> And the answer to this would be to override 'alloc' or something like

init, rather. See class clusters for an excellent example of that technique:
you never ever see a, say, NSString instance.

KG> that and put an error message in it...

Well, it's not _that_ easy, since a subclass would quite probably want to
inherit +alloc and call [super init].
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


References: 
 >Re: Abstract classes and methods (From: stuartbryson <email@hidden>)
 >Re: Abstract classes and methods (From: Karl Goiser <email@hidden>)

  • Prev by Date: RE: Abstract classes and methods
  • Next by Date: RE: Abstract classes and methods
  • Previous by thread: Re: Abstract classes and methods
  • Next by thread: Re: Abstract classes and methods
  • Index(es):
    • Date
    • Thread