Re: properties and subclasses
Re: properties and subclasses
- Subject: Re: properties and subclasses
- From: Jens Alfke <email@hidden>
- Date: Thu, 05 Jul 2012 08:40:38 -0700
On Jul 5, 2012, at 8:25 AM, James Maxwell wrote:
> I have a situation where I've created a subclass that overrides a number of synthesized property accessors in its superclass. What I'm wondering is whether the overridden methods will get called when using dot syntax, or if this will just return the (inherited) synthesized properties?
The overridden methods. Properties are just syntactic shorthand for getter and setter methods, so the usual Objective-C rules of inheritance work. (In Objective-C all methods are 'virtual' in C++ terminology; if a method is overridden in a subclass, the only way to call the inherited method is via 'super' from inside a subclass method.)
—Jens
_______________________________________________
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