Search code examples
cocoaxcodequartz-composer

quartz composer view output: How can I get immediately the new values of outputs, if they change?


I created a cocoa program with a quartz composer view. I can get the output values with:

[qcView valueForOutputKey:@"Output"]

But how can I get immediately the new values of outputs, if they change?


Solution

  • Using Key-Value Observing, your class can be sent a message automatically when the value changes.

    For a QCView, you need to connect a QCPatchController instance (which is a layer that adds KVO compliance) --- see http://developer.apple.com/mac/library/technotes/tn2005/tn2146.html for details.