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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to