DO, bycopy
DO, bycopy
- Subject: DO, bycopy
- From: Miguel Morales <email@hidden>
- Date: Thu, 25 Oct 2001 14:51:07 -0700
Dear all,
I have DO between 2 threads, and I'm having trouble getting the bycopy
keyword to work for my classes and not just the foundation classes. Has
anyone else seen this behavior, is there some magic handshake I need to
get this to work? The behavior is described below:
I have a program with DO where I am passing objects using the bycopy
keyword. This _should_ give me a new copy of the object in the new
thread, where I can manipulate the copy locally. If I do a test run
using NSNumber and/or NSArray, the whole shebang works like a charm.
However, I have a simple container class that I want to pass. The
container class publicly implements NSCopying and NSCoding, and they
both work (I can copy and archive/read from the disk without problem).
However, when I use DO it looks like I'm getting a proxy instead of a
copy. Everything holds until the first thread enters a run loop, isa is
"wrong," as I would expect in a proxy, and if I make too many calls (a
few), everything locks up (presumably because the call stack is full).
Why won't my little custom class be sent as a copy and not a proxy?
Thanks in advance,
-Miguel