• 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 one-step listening but two-step notifying?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO one-step listening but two-step notifying?


  • Subject: KVO one-step listening but two-step notifying?
  • From: Hamish Allan <email@hidden>
  • Date: Fri, 23 Dec 2005 00:20:06 +0000

Hi,

I'm trying to implement an KVO-compliant object which proxies a KVO- compliant property from either one object or another, depending on an internal setting.

- (id)property
{
if (_setting)
return [_object1 property];
else
return [_object2 property];
}

I can register for change notifications for the appropriate key on both _object1 and _object2, but these notifications come in the form of observeValueForKeyPath:ofObject:change:context: messages. To ensure that my dependents are properly notified, I am supposed to send two messages: a "willChange" message prior to the change, and a "didChange" afterwards, but as far as I can tell I only get the observeValue.. message when _objectN property has already changed.

What is the best way to ensure KVO compliance in this case?

Thanks,
Hamish


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Prev by Date: KVO one-step listening but two-step notifying?
  • Next by Date: newbie help on printing
  • Previous by thread: Re: KVO one-step listening but two-step notifying?
  • Next by thread: newbie help on printing
  • Index(es):
    • Date
    • Thread