• 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 Response for incomplete paths
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO Response for incomplete paths


  • Subject: KVO Response for incomplete paths
  • From: Gordon Apple <email@hidden>
  • Date: Mon, 19 May 2008 14:02:07 -0500

    I'm currently trying to implement undo for drawing using code based on
Sketch and am running into KVO problems on "Shape" properties.  Sketch uses
a dictionary of Properties that applies to selected Shapes (i.e.,
"Graphics").  Some of my parameters are compound, e.g., "Shadow" is a
referenced object.  So while Shape has a "hasShadow" property, there is also
a "shadow.angle" property path in my parameter list.  I don't see an answer
to these questions in the KVO docs.

1.  What happened when you try to observe a property that doesn't exist?
(e.g., is there is no shadow, there is no "shadow.angle".  Do I have to test
"hasShadow" to disallow observing "shadow.angle when the properties list is
scanned?

2.  What happens when you try to stop observing a property that does not
exist (a la Q1)?

    I was hoping both of these would simply not do anything if the path was
not complete (e.g., "shadow.angle").  Unfortunately, it appears to be
blowing me out of the water (unless that is actually happening elsewhere).
Is KVO supposed to have a benign response to these cases or am I going to
have to filter them when scanning the properties list?

_______________________________________________

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 Response for incomplete paths
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Delegates
  • Next by Date: Re: Cocoa et al as HCI usability problem
  • Previous by thread: Re: Delegates
  • Next by thread: Re: KVO Response for incomplete paths
  • Index(es):
    • Date
    • Thread