Convenience methods and classes
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