• 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: Objective-C and it's future
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Objective-C and it's future (From: Damien Sorresso <email@hidden>)
 >Re: Re: Objective-C and it's future (From: "Shawn Erickson" <email@hidden>)
 >Re: Objective-C and it's future (From: Rob Ross <email@hidden>)
 >Re: Re: Objective-C and it's future (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: Re: Re: Objective-C and it's future
  • Next by Date: Re: Objective-C and it's future
  • Previous by thread: Re: Re: Objective-C and it's future
  • Next by thread: Re: Objective-C and it's future
  • Index(es):
    • Date
    • Thread