I am having some issues with setting values using MacRuby and Cocoa. I have the inserted the QCView and the QCPatchController into the XIB and loaded the composition into the QCPatchController. Everything is running but I cannot access the published inputs on the QCView.
attr_accessor :myQCView #this is bound to the QCController
...
def AppController
txt = "I did it"
@myQCView.setValue(txt, forKeyPath:"patch.text.value")
end
I am getting an error:
NSUnknownKeyException: [<NSNull 0x7fff7115e000> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key value. (RuntimeError)
I’m stumped. I have tried searching the MacRuby forums but I have had no luck.
thanks for your advice
Read the exception message:
Why would you be trying to set the key
valueof an NSNull object?Let’s look at the code. What are you trying to set the key
valueof?I see: Your QCView’s
patch.text.So, your QCView’s
patch.textis an NSNull object.That’s not an accurate name for the variable, then. I suggest “
myQCPatchController”, or just “patchController”.So it now looks like you’re trying to set the value of the
textport of the root patch. Perhaps the root patch does not actually have a port namedtext?You may want to ask about this problem on the Quartz Composer mailing list.