Hi, I am studying the following:
<<inline: qc_addInputPort.png>>
I am replicating the NSStepper interface seen in the math, lighting, etc. patches to add/remove dynamic ports.
After some trial and error, I've got it working nicely. Except, when I 'drag and copy' an instance of a patch or add a second patch from the patch inspector, add some dynamic ports to the new instance, then try and modify the dynamic ports on the original patch, qc crashes with an exception:
If the NSStepper goes down:-[QCPlugInPatch createInputPortWithArguments:forKey:]: Key "String_2" is already in use by node <QCPlugInPatch = 0x18B48660 | Plug-In = <UITestPlugIn: 0x18b49060>>
If I go up: -[UITestPlugIn _valueForInputPort:]: Argument "port" cannot be nullAlso, when I drag and copy the populated instance, the new copy reverts to the init state of the plugin rather than copying the number of dynamic ports, their data. It seems I am not instantiating things properly.
I've followed a couple of plugin code examples (freeframehost, ImageInfo) and have the following broad architecture:
I have bound the values of the NSStepper (and textfieldcell) to files owner plugIn.noOfStrings, where noOfStrings is a
dyanamic property of the QCPlugIn.I have subclassed QCPlugInViewController to handle the IBAction I called amendStrings that adds, removes in increments in response to NSStepper and when the textfield is manually edited.
The subclass of QCPlugInViewController looks like this:
@interface UITestPlugInViewController : QCPlugInViewController
{
int currentStringCount;
int previousStringCount;
int diff;
BOOL raisedFlag;
BOOL loweredFlag;
BOOL firstCall;
}
- (IBAction) amendStrings:(id)sender;
@end
I am wondering: do I need to subclass QCPlugInViewController at all?
Should the ivars (the ints) be dynamic properties of qcplugin? and are
therefore 'serialised' when the patch is copied?
Any hints with this would be gratefully received. I feel I am doing too much and this could be simpler, at least a little more elegant!
Source code here (too large to attach): Link: <http://ellington.tvu.ac.uk/downloads/UITest.zip> Please be kind if I have approached this completely wrong! Kind regards, Ian ******************************* Ian Grant Senior Lecturer in Digital Art Faculty of the Arts Thames Valley University Ealing, UK W5 5DX <[EMAIL PROTECTED]> *******************************
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]

