• 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: Chris Gehlker <email@hidden>
  • Date: Tue, 28 Aug 2001 21:47:15 -0700

On 8/29/01 8:54 PM, "stuartbryson" <email@hidden> wrote:

> In C++ it is possible to force both classes and methods to be abstract.
> That is classes that cannot be instantiated without being subclassed and
> particular methods overrided. How do I force abstract classes and
> methods in Obj-C.

AFAICT you can't. And you wouldn't want to if you could. Remember, pure
virtual classes occur at the top of inheritance trees to define the
interface to the tree. But in ObjC every class is a descendent of NSObject:
you never define the top of the tree. Even a class that functions as a pure
virtual class is going to have to define init as [super init] and dealloc as
[super dealloc].

Think Java, not C++, here.
--
When I was a boy I was told that anybody could become President. Now I'm
beginning to believe it. -Clarence Darrow, lawyer and author (1857-1938)


  • Follow-Ups:
    • Re: Abstract classes and methods
      • From: Ondra Cada <email@hidden>
    • Re: Abstract classes and methods
      • From: Aaron Tuller <email@hidden>
    • Re: Abstract classes and methods
      • From: Greg Titus <email@hidden>
References: 
 >Abstract classes and methods (From: stuartbryson <email@hidden>)

  • Prev by Date: Re: Plugins (was Re: CoreFoundation question)
  • Next by Date: Re: Bad error?
  • Previous by thread: Abstract classes and methods
  • Next by thread: Re: Abstract classes and methods
  • Index(es):
    • Date
    • Thread