Re: properties and subclasses
Re: properties and subclasses
- Subject: Re: properties and subclasses
- From: Graham Cox <email@hidden>
- Date: Fri, 06 Jul 2012 01:41:22 +1000
On 06/07/2012, at 1:25 AM, James Maxwell wrote:
> With this setup, when I call mySubclassThing.aProp, do I get the synthesized property (inherited) or the overridden method return? That is, do I have to deliberately call [mySubclassThing aProp] to get the method return (i.e., not using dot syntax)? Or, saying it another way, does a subclass' hand-coded accessor override the superclass' synthesized accessor?
>
> Strange question, I suppose, but it isn't totally clear to me what actually happens.
It will work fine.
@synthesize is really just a bit of syntactic sugar to save you hand-writing -foo and setFoo:, so overrides of those work normally whether synthesized or not, and the dot syntax is just syntactic sugar for the usual square brackets notation (which itself is shorthand for a call to objc_msg_send).
It'll work fine.
--Graham
_______________________________________________
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