• 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 query
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO query


  • Subject: KVO query
  • From: Jonathan Mitchell <email@hidden>
  • Date: Wed, 13 Aug 2014 22:53:29 +0100

I have a key path like so which is observed:

submission.status.name

At one point i need to invoke a manual KVO notification like so:

[submission willChangeValueForKey:@“status”];
[submission didChangeValueForKey:@“status”];

This raises like so:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot update for observer <NSKeyValueObservance 0x608000ac21b0> for the key path "status.name" from <Submission 0x6080003aa800>, most likely because the value for the key "status" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the Submission class.’

I am using manual KVO because my submission object is a wrapper around a Mono managed class.
I receive a callback that the managed status object has changed and want to propagate that via KVO.
The true situation is generic : i receive a callback that a managed property P has changed and want to raise manual KVO notifications in a compliant manner.

Is there a way for me to programatically determine what sequence of manual  KVO notifications  I will require to maintain KVO compliance?
I imagine that the framework code uses - observationInfo to achieve this but that is opaque to client code.
I am trying to avoid having lots of explicit +keyPathsForValuesAffectingValueForKey: methods.

Thanks

Jonathan












_______________________________________________

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 query
      • From: Quincey Morris <email@hidden>
    • Re: KVO query
      • From: Ken Thomases <email@hidden>
    • Re: KVO query
      • From: Lee Ann Rucker <email@hidden>
  • Prev by Date: Re: Advise on referencing NSDocument from custom view
  • Next by Date: Re: KVO query
  • Previous by thread: Backup eligibility (iCloud/iTunes) for iOS shared app group container
  • Next by thread: Re: KVO query
  • Index(es):
    • Date
    • Thread