• 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 returning nil for old values, and mmalc's Graphics Bindings example
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO returning nil for old values, and mmalc's Graphics Bindings example


  • Subject: KVO returning nil for old values, and mmalc's Graphics Bindings example
  • From: Tim Lucas <email@hidden>
  • Date: Wed, 18 May 2005 21:55:15 +1000

Hi all,

Did anybody figure out why in mmalc's Graphics Bindings example he had to to the following workaround, because KVO wasn't returning the old values?

Quoting "Graphics Bindings" example, GraphicsView.m, observeValueForKeyPath:ofObject:change:context:
/*
Should be able to use
NSArray *oldGraphics = [change objectForKey:NSKeyValueChangeOldKey];
etc. but the dictionary doesn't contain old and new arrays...??
*/

I have come across exactly the same problem.

I have 4 different set of KVO's being registered within my view's bind: method, and only the first one will return the old values in the change dictionary when a change is observed, the other 3 return nil, even though all the KVO registrations look like this:

[object addObserver:self
	forKeyPath:key
	options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld)
	context:AContextPointer];

The context pointers look like:
static void *ContextPointerOne = (void *)1091;
static void *ContextPointerTwo = (void *)1092;
static void *ContextPointerThree = (void *)1093;
static void *ContextPointerFour = (void *)1094;

Any ideas?

- tim lucas

_______________________________________________
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


  • Follow-Ups:
    • Re: KVO returning nil for old values, and mmalc's Graphics Bindings example
      • From: "Sean McBride" <email@hidden>
    • Re: KVO returning nil for old values, and mmalc's Graphics Bindings example
      • From: Tim Lucas <email@hidden>
  • Prev by Date: Re: Timeout for NSCell's trackMouse:inRect:ofView:untilMouseUp:
  • Next by Date: Re: A CoreData Limitation?
  • Previous by thread: Base coordinate system definition
  • Next by thread: Re: KVO returning nil for old values, and mmalc's Graphics Bindings example
  • Index(es):
    • Date
    • Thread