Re: properties and subclasses
Re: properties and subclasses
- Subject: Re: properties and subclasses
- From: James Maxwell <email@hidden>
- Date: Thu, 05 Jul 2012 08:56:27 -0700
Okay, thanks. That seems reasonable, but I wanted to double-check. I remember reading some discussion a while ago that seemed to suggest that dot syntax was only for calling synthesized properties, not methods… Though precisely what a synthesized property would be, other than an accessor method (operative word being "method"), was never really explained! ;-)
Thanks again.
J.
On 2012-07-05, at 8:40 AM, Jens Alfke wrote:
>
> 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
James B Maxwell
Composer/Doctoral Candidate
School for the Contemporary Arts (SCA)
School for Interactive Arts + Technology (SIAT)
Simon Fraser University
_______________________________________________
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