Archive for the ‘quartz’ tag
Controlling a QuartzComposer Composition in a Cocoa App
There is a way to set controllers directly from within Interface Builder to the published inputs of a Quartz Composition (QCView in the IB). This is nice, if you just want to do an animation that you control from the GUI elements. I’m working on an animation controlled within the program, and I really need to get to those published inputs to send the decisions made in the application.
This little solution may not be world changing, but I’ve searched for this little piece of code for a couple of minutes. so just as a reminder:
IBOutlet QCView * qcAnimation;
[qcAnimation setValue: (id) forInputKey: @"myKey"];
Yes… so easy! but Why it isn’t in the documentation? Well it is, but it won’t appear on the QCView or QCComposition or the quick help if you need. So, how to search for this kind of methods very quick? I found it was nicer to take a look at the header files than the documentation. If one goes to the QCView header it says:
@interface QCView : NSView <QCCompositionRenderer>