NSThread with Distributed Objects
NSThread with Distributed Objects
- Subject: NSThread with Distributed Objects
- From: John Nairn <email@hidden>
- Date: Tue, 13 Aug 2002 15:04:05 -0600
I have a program that I am trying to convert to multiple threading but I
am stopped by a confusing error. This program uses distributed objects
with a calculation thread to create plotting objects and a main thread
where all interface commands are done. As far as I know, the
calculation thread never calls the AppKit. All seems to work OK, but
when the calculation thread is over and the main thread is drawing the
objects, the following error appears:
2002-08-13 14:55:14.860 ScienceCocoa[2928] *** -[NSCalibratedRGBColor
viewBounds]: selector not recognized
This occurs when the drawing code is calling a class that was created in
the main thread and filled with data in the calculation thread. The
class is called "PlotHeader" and its single instance variable is
"plotObjects". This error seems to come when the main thread tries the
mssage
[plotObjects viewBounds]
and Objective C seems to now think plotObjects has become an
NSCalibratedRGBColor instead of what is was before. The error is usually
of this form, but sometimes other errors occurs which I expect are also
because Objective C somehow no longer knows that plotObjects is pointing
to a PlotHeader object.
Does this error make sense or any ideas what causes it?
P.S.: The code works fine when non threaded.
----------------
John Nairn (1-801-581-3413, FAX: 1-801-581-4816)
Web page:
http://www.mse.utah.edu/~nairn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.