> On Jan 4, 2016, at 8:24 AM, Dave <d...@looktowindward.com> wrote:
> 
> myClassB = myClassA.propA;                    //Warning on this line saying 
> return type is not ClassB

You have to declare the override in the subclass’s @interface, with the 
modified return type. Otherwise callers have no idea that your override exists 
or returns a different (more specific) class.

And as others have said, the override has to return a subclass of the inherited 
property, otherwise it’s not compatible. (The same goes for any method return 
type, not just a property, by the way.)

—Jens
_______________________________________________

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

This email sent to arch...@mail-archive.com

Reply via email to