Re: NSConnection problems - HELP
Re: NSConnection problems - HELP
- Subject: Re: NSConnection problems - HELP
- From: Ondra Cada <email@hidden>
- Date: Sat, 15 Sep 2001 12:27:03 +0200
Steve,
>
>>>>> Steve Gehrman (SG) wrote at Sat, 15 Sep 2001 02:14:58 -0700:
SG> To make things more complex, I'm passing the parameter to another
SG> thread. NSString does work, maybe it's just getting lucky?
Well, _if I understand properly_, you have three threads, A, B, C. You have
an object 'a' which "belongs to" thread A; you send in through DO to thread
B, and then you give it directly (not through DO) to thread C, which tries to
use it. Right?
If so, the problem is that
- sending object through DO to thread B actually means that a proxy object
(belonging to thread B) is created. Whatever communication in thread B is
performed with the proxy, it is redirected through connection to the
"original" object a in thread A.
- now, if you try to access this proxy which belongs to B from thread C, it
crashes (since the proxy belongs to B and knows that).
With strings it works, since they are send _bycopy_. That means that instead
of the proxy there is created a _copy_ of string a in the thread B (and
again the same for thread C).
Last note -- if you are seding the object from B to C through DO too, it's
really bad: it would seem to indicate that Apple has a bug in DO, which
prevents sending of proxy through a different connection than the one which
created it. If really so (should be explicitly checked), it seems to me the
only quick workaround for you is to send your object bycopy (if possible, of
course).
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc