On Wed, Oct 15, 2008 at 11:36 AM, Chris Suter <[EMAIL PROTECTED]> wrote:
> On Wed, Oct 15, 2008 at 9:03 PM, John Engelhart
> <[EMAIL PROTECTED]> 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. :-)
>

Presumably you could override +(id)alloc to be +(MyClass)alloc on
classes that you knew implemented ambiguous init methods?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to