• 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: adding something to a setter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: adding something to a setter


  • Subject: Re: adding something to a setter
  • From: Charles Srstka <email@hidden>
  • Date: Thu, 06 Oct 2011 19:12:22 -0500

On Oct 6, 2011, at 6:22 PM, Quincey Morris wrote:

> It occurs to me that there may be a lower-tech solution. If you created an abstract superclass of the class whose setters you wanted to override, you could synthesize the properties in the superclass, override them normally, and call super in the subclass. There's still a bit of ugliness in this approach (e.g. you have to expose the private superclass in the subclass's public .h file), though not much perhaps. Also, since the compilers have been getting pickier in their recent versions regarding the way property methods are defined, there may turn out to be a compile-time obstacle, but in principle I think this approach should work -- you'd basically be getting the compiler to delve into the runtime for you.

But isn't creating a whole abstract superclass for this a lot more of a hassle than just making a private property? What would you get from that approach that you wouldn’t get from just having the getters and setters for a property “foo” call through to the synthesized accessors for a private property “privateFoo”?

Charles_______________________________________________

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: adding something to a setter
      • From: Quincey Morris <email@hidden>
References: 
 >adding something to a setter (From: Torsten Curdt <email@hidden>)
 >Re: adding something to a setter (From: Quincey Morris <email@hidden>)
 >Re: adding something to a setter (From: Torsten Curdt <email@hidden>)
 >Re: adding something to a setter (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: adding something to a setter
  • Next by Date: Re: adding something to a setter
  • Previous by thread: Re: adding something to a setter
  • Next by thread: Re: adding something to a setter
  • Index(es):
    • Date
    • Thread