• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: properties and subclasses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >properties and subclasses (From: James Maxwell <email@hidden>)

  • Prev by Date: Re: properties and subclasses
  • Next by Date: Re: properties and subclasses
  • Previous by thread: Re: properties and subclasses
  • Next by thread: Modal event processing
  • Index(es):
    • Date
    • Thread