• 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: 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


  • Follow-Ups:
    • Re: properties and subclasses
      • From: James Maxwell <email@hidden>
References: 
 >properties and subclasses (From: James Maxwell <email@hidden>)

  • Prev by Date: Re: NSInteger vs int vs int32_t
  • Next by Date: Re: properties and subclasses
  • Previous by thread: properties and subclasses
  • Next by thread: Re: properties and subclasses
  • Index(es):
    • Date
    • Thread