Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning
Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning
- Subject: Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning
- From: "Chris Suter" <email@hidden>
- Date: Wed, 15 Oct 2008 21:36:11 +1100
On Wed, Oct 15, 2008 at 9:03 PM, John Engelhart
<email@hidden> wrote:
>
> On Oct 14, 2008, at 7:11 AM, Chris Suter wrote:
>>
>> You can't override the type for existing methods. For example,
>> initWithString: always returns an id. You can define them as returning
>> something different but the compiler will ignore it.
>
> Just a clarification on this particular point- it is possible to override
> the type(s) of existing methods, both the argument and return types.
You're quite right.
What I meant to point out was that you can't easily override init
methods because of the problem with alloc returning id. That was
something I came across a while back which was why I got the details
slightly wrong. :-)
Sorry for any confusion caused.
-- Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden