• 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
KVO Setting a flag for any property change
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO Setting a flag for any property change


  • Subject: KVO Setting a flag for any property change
  • From: Andre Masse <email@hidden>
  • Date: Wed, 14 Dec 2011 08:29:54 -0500

Hi,

I have a superclass which has a "modified" BOOL property and a bunch of subclasses based on it. When any property is changed, I need to set this flag to YES. I can either write a setter for all properties and set this flag there, or observe all properties and set the flag in -observeValueForKeyPath. Both approach involve a lot of boilerplate coding (some subclasses have 20+ properties).

I thought about using -keyPathsForValuesAffectingModified: but I don't see how I can set a flag using this.

Any ideas?

Thanks,

Andre Masse
_______________________________________________

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: KVO Setting a flag for any property change
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: Updating an app's help
  • Next by Date: Re: KVO Setting a flag for any property change
  • Previous by thread: Re: Updating an app's help
  • Next by thread: Re: KVO Setting a flag for any property change
  • Index(es):
    • Date
    • Thread