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

Re: KVO query


  • Subject: Re: KVO query
  • From: Lee Ann Rucker <email@hidden>
  • Date: Wed, 13 Aug 2014 22:07:52 +0000
  • Thread-topic: KVO query

Have you implemented +automaticallyNotifiesObserversForKey: and returned NO for “status” ?

On Aug 13, 2014, at 2:53 PM, Jonathan Mitchell <email@hidden> wrote:

> 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


References: 
 >KVO query (From: Jonathan Mitchell <email@hidden>)

  • Prev by Date: KVO query
  • Next by Date: Re: KVO query
  • Previous by thread: KVO query
  • Next by thread: Re: KVO query
  • Index(es):
    • Date
    • Thread