Correct,
it is only safe to access dynamically created input/output ports during the
execute at time. This is in the Docs (somewhere).
The solution typically is to implement a second set of keys you control that
you @synthesize. In your execute at time method, whenever an input key updates,
you then update the value of your private, secondary key.
ie:
if([self didValueForInputKeyChange:@"inputSomeKeyName"])
{
// update our internal key state to reflect the QCs port state.
[self setSomeKeyName:self.inputSomeKeyName];
}
where inputSomeKeyName is the QC port declared dynamically, and someKeyName is
your own @synthesized property.
you then can tell your delegate to update the private keys, or read the private
keys whenever the run loop interrupts execution, since you cant control when
you will get that callback, etc.
This is at least, what I have done in similar situations.
On Mar 25, 2010, at 12:41 PM, Anatol Ulrich wrote:
> Ello,
>
> I've got a plugin that does some TCP/IP communication via NSStream. Problem
> is: apparently, when I'm in the delegate method stream:handleEvent:, I can't
> access my plugin's ports -- only when I read/write them inside the plugin's
> -execute method I get the desired results (available/updated values for
> input/output ports). What's a solution for that problem? I don't have a
> separate thread, I schedule the streams in the run loop associated with
> -execute's caller and then do
>
> NSRunLoop *loop = [NSRunLoop currentRunLoop];
> [loop runUntilDate:[NSDate distantPast]];
>
> inside -execute as well. Spawning another thread for the thread handling
> didn't help. Do I have to resort to helper ivars which I read/write in the
> stream delegate and the execute method? Other solutions?
>
> Cheers,
> Anatol
> _______________________________________________
> 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/doktorp%40mac.com
>
> This email sent to [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]