Re: -observeValueForKeyPath:ofObject:change:context: only, > defined for abstract class.
Re: -observeValueForKeyPath:ofObject:change:context: only, > defined for abstract class.
- Subject: Re: -observeValueForKeyPath:ofObject:change:context: only, > defined for abstract class.
- From: Todd Ransom <email@hidden>
- Date: Sun, 8 Jan 2006 09:43:16 -0700
There is a good example of how to implement undo using KVO in Aaron
Hillegass' book:
http://www.bignerdranch.com/products/cocoa1.shtml
I think it is based on NSDocument but it should be easy to adapt.
Maybe one of the Apple folks can explain why the example calls super.
It sounds like a documentation bug.
Todd Ransom
Return Self Software
http://returnself.com
On Jan 8, 2006, at 6:51 AM, David Burnett wrote:
email@hidden wrote:
>I have never called super in my KVO methods. All you should need to
>do is make your changes using the observed objects. What are you
>trying to accomplish when the observed objects change?
I was experimenting to see if I could use KVO to drive an undo
mechanism in a non document based application.
The reason I called super was apple example in the documentation
called super. It didn't however say what class the observer inherited
from :-) nor did it say anything about the class at the top end of
the inheritance chain having to do the value setting.
Couple what with the error message referencing FlameController, that
wasn't abstract and implemented -observeValueForKeyPath, I was
on the point of abandoning Binding altogether.
Dave
_______________________________________________
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
_______________________________________________
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