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

Convenience methods and classes


  • Subject: Convenience methods and classes
  • From: Drew McCormack <email@hidden>
  • Date: Thu, 31 Jan 2002 20:02:55 +0100

I want to write a convenience constructor, but can't figure out how I can access the Class instance from within the class method. For example, if I want to write a method "+expression" which allocates and initializes an "Expression", how do I allocate the expression in the method?
Can I just do this
[self alloc]

Probably not.
Or do I have to rewrite the method for every subclass of Expression I write, doing this
[SubExpression alloc]

I sure hope the latter is not right. I must be able to inherit the class method, right?

Drew McCormack


  • Follow-Ups:
    • Re: Convenience methods and classes
      • From: Ondra Cada <email@hidden>
    • Re: Convenience methods and classes
      • From: Greg Titus <email@hidden>
  • Prev by Date: Re: Localization Language priority ?
  • Next by Date: Re: System contextual menus
  • Previous by thread: timers and background memory management
  • Next by thread: Re: Convenience methods and classes
  • Index(es):
    • Date
    • Thread