Problem using QCPatchController

Korki696's picture

Hello, I am having a lot of issues adding a QCPatchController to my project. I am able to add the QCView and the QCPatchController without any problems. The problem occurs when I load a composition into it. Once I add it and save it I get an error or it just crashes. The error is always different. Here are some of them.

The document “MainMenu.xib” could not be saved. -[NSXMLElement state]: unrecognized selector sent to instance 0x40287a960

The document “MainMenu.xib” could not be autosaved. -[__NSCFDictionary state]: unrecognized selector sent to instance 0x40287a960

The document “MainMenu.xib” could not be saved. -[NSXMLNamedNode state]: unrecognized selector sent to instance 0x40358f780

The document “MainMenu.xib” could not be saved. -[NSXMLElement state]: unrecognized selector sent to instance 0x403925340 --- Same as first error but different instance.

The document “MainMenu.xib” could not be saved. -[__NSFastEnumerationEnumerator state]: unrecognized selector sent to instance 0x402831280

The document “MainMenu.xib” could not be saved. -[NSXMLChildren state]: unrecognized selector sent to instance 0x40346be20

I am running xCode 4.2.1 on OS X 10.7.2

Anyone have any idea of why this could be happening?

Thanks -Korki

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

itsthejayj's picture
Re: Problem using QCPatchController

Same. Ended up just using Parameter view :(

franz's picture
Re: Problem using QCPatchController

I think -I may be wrong- that in QC under the hidden preferences, you checked "Show Private IB palette". Revert back to normal and the problem should go away.

Korki696's picture
Re: Problem using QCPatchController

I have double checked the hidden preferences and it is not checked.

Thanks -Korki

gtoledo3's picture
Re: Problem using QCPatchController

I'm pretty sure that happens w/ Show Private IB Palette too. (I don't think that option has ever done anything "right" by the time it was release, but I may be wrong on that...)

Korki696's picture
Re: Problem using QCPatchController

Since it is not the hidden preferences is there any other way to access the published I/O's by only using the QCView? I would like to no have to use the parameter view.

Thanks -Korki

franz's picture
Re: Problem using QCPatchController

The default QC app Xcode template uses a QCview and shows how to bind published ports directly, without using a QCPatchController.

Korki696's picture
Re: Problem using QCPatchController

Where can I find this template?

Thanks for you help -Korki

franz's picture
Re: Problem using QCPatchController

.... create new xcode project, select QC app...

Korki696's picture
Re: Problem using QCPatchController

I do not have that option. What version of xCode and OS X are you on? I have Lion and xCode 4.2.1

Thanks -Korki

Korki696's picture
Re: Problem using QCPatchController

I got everything figured out. The method I used is the following.

[qcView setValue:[NSNumber numberWithInt:3] forInputKey:@"Source"];

I am assuming this is what they did in the example.

Thanks again for your help!

-Korki

dust's picture
Re: Problem using QCPatchController

in the new Xcode there isn't a quartz application template, and the QCPatchController has never worked for me. however you can create a cocoa app and add the quartz framework.

#import <Quartz/Quartz.h>

and then use an object controller to bind your published ports. seems like you figured out how to set a value programmatically which is what i normally do. i just drag from my xib file to my header and auto create properties and actions then programmatically set my published ports like you have but sometimes its nice to bind things via your xib file.

binding your patch in a xib file is sort of like how the documentation states but instead of using a qc patch controller you use an object controller and bind its contents to a qc view by class.

first you need to make a qc file with a published port lets call it "Text"...

then follow these steps....

step 1: make a new cocoa project...
step 2: add quartz framework via buid phases tab and import the framework to your project either in the pre compile header, or app delegate...
step 3: add qc view to your xib and load your composition
step 4: add object controller to your xib... 
step 5: change object controllers class to "QCView" without quotes.
step 6: control drag your object controller to your qc view and select "content"
step 7: add a slider and bind its value to your object controller and set its model key path to "patch.Text.value" without quotes.....

attached is a simple project example.

using binding and kvc programing lets you do some complicated things very quickly. quicker than most languages. just by adding a core data model and binding the model to your interface elements all in a xib file is extremely useful. ;)

PreviewAttachmentSize
QCPatchController.zip122.36 KB

franz's picture
Re: Problem using QCPatchController

no QCapp template in Xcode 4 ? non working QCpatchController in Xcode 4 ? Crippled QC public API ? Crippled QC in Lion ?

for me this clearly means QC is going nowhere.... Sounds like it's about time to move on. (for me at least)

gtoledo3's picture
Re: Problem using QCPatchController

...adding on, Xcode 4 and "better"(ha) have really been bad. It's obviously more imperative that it works, but there are still bugs with Xcode, and the new Xcode system is distasteful and seems like a step backwards.

The QC Editing app has been pretty bad all along. You can't run a composition, profile, and not see it leak like a sieve. It's horrible. Running the composition in it's own app is the way to go. That said, the Lion Editor has some instances where it's actually better than what was going on in SL. I'm hoping some of the Lion bugs can get fixed w/ updates, but I'm not holding my breath either. Updates did bring about some bug fixes in SL though.

harrisonpault's picture
Re: Problem using QCPatchController

franz wrote:
no QCapp template in Xcode 4 ? non working QCpatchController in Xcode 4 ? Crippled QC public API ? Crippled QC in Lion ?

for me this clearly means QC is going nowhere.... Sounds like it's about time to move on. (for me at least)

Hey Franz! Many, including myself, would be very sad to see you move on, although it is quite understandable. If you are serious, might you consider open sourcing some of your outrageously helpful and inspiring plugins for the die-hards?

franz's picture
Re: Problem using QCPatchController

Sure I will. I'm still here tho'.

Thanks for the kind words.

itsthejayj's picture
Re: Problem using QCPatchController

Is is possible to uses this way of binding to output ports from one qcview into another qcview?

franz's picture
Re: Problem using QCPatchController

it is possible to pass data from one qcview to another.

mlop3s's picture
Re: Problem using QCPatchController

Hi,

i'm new to both Cocoa and Quartz Composer. I've already managed to create two patches that use OpenGL and they are working fine. Now I want to use them in an application so that the user can call it through command prompt passing the path to 5 pictures.

Right now i'm just trying to simply use a check box in order to enable and disable some features exposed from my composition.

I've used the example from dust, and changing the text works fine. However, when i change his composition to export "Show Background" (I've simply called it background), nothing happens when i click the checkbox. I can't understand why Text works through binding and the Boolen value seem not to work. Am i missing some background information on how the CheckBoxes work?

I've simply added the checkbox and set the BindTo -> ObjectController as done with the Text. Then on Model Key Path i've entered patch.background.value.

The code compiles and runs, but when i click the checkbox, it gets selected but nothing happens.

Thanks.

dust's picture
Re: Problem using QCPatchController

patch.Enable.value

value will turn on and off a published port input named Enable. see example...

PreviewAttachmentSize
checkBox.zip388.13 KB