Re: Objective-C and it's future
Re: Objective-C and it's future
- Subject: Re: Objective-C and it's future
- From: Thomas Davie <email@hidden>
- Date: Sat, 8 Jul 2006 02:28:23 +0100
On 8 Jul 2006, at 02:23, Shawn Erickson wrote:
On 7/7/06, Rob Ross <email@hidden> wrote:
Are you saying you can write an init method with a signature like
this:
- (FooClass *)init;
I thought that if you overrode a method from a superclass, the
signatures must match (including the return type).
Or am I wrong about that?
Sorry should have been more clear in my wording (was thinking of
designated initializers of various classes that I have)... you can
specify type for say -(MyBubba*) [MyBubba initWithGump:] and the
compiler will warn if you tried to assign it to a variable with the
wrong type.
The problem is you then can't do the same when you subclass.
If I were to subclass MyBubba, and write this:
-(MyBubbaSub *) [MyBubbaSub initWithGump: andForrest:]
the compiler will stop throwing warnings, and instead throw errors.
Bob
_______________________________________________
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