views:

392

answers:

1

If subclass in objective-c wants to override a super class's method, does it have to match the return type too?

+2  A: 

Yes, it must have the same selector.

update:

IIRC the arguments also needs to have the same types.

update:

It seems that all methods of the same selector needs to have equivalent types across all classes when linking dynamically, not so with static linking: linky

yngvedh