Re: Problem overriding a factory class mehtod
Re: Problem overriding a factory class mehtod
- Subject: Re: Problem overriding a factory class mehtod
- From: Ivan Kourtev <email@hidden>
- Date: Thu, 2 Nov 2006 21:59:57 -0500
On Nov 2, 2006, at 7:14 PM, Shawn Erickson wrote:
Two ways come to mind...
======== FIRST WAY ========
@implementation FooA
+ (id) fooWithInt:(int)x
{
return [[[self alloc] initWithInt:x] autorelease]; // "self" will
be the class that was sent the message, FooB if [FooB fooWithInit]
}
That's what I was looking for.
The key difference being
[[[self alloc] init...
instead of
[[[ClassName alloc] init...
Thanks!
-- ivan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden