help w/ async message queue
help w/ async message queue
- Subject: help w/ async message queue
- From: "William Zumwalt" <email@hidden>
- Date: Thu, 17 Jan 2008 22:09:03 -0600
While switching from NSConnection to YAMessageQueue, I ran into some
problems and was hoping someone could help. I'm obviously doing something
wrong (because my stuff crashes).
I have something like this running in a new thread.
while (1) {
Data *data = [[Data alloc] init];
[data set:value];
[data set:another];
[self updateProgress:data];
}
And in the base class of the above I do the following ...
- (id) initWithObject:(id) mainObject
{
...
controller = mainObject;
clientQueue = [controller messageQueue];
messageQueue = [[YAMessageQueue alloc] init];
[NSThread detachNewThreadSelector:@selector(threadMain:)
toTarget:self withObject:nil];
}
clientQueue = [controller messageQueue];
...
[[clientQueue proxyForTarget:controller] updateProgress:data];
The above calls a method in my main thread (so that my thread can update the
gui) ...
- (void) updateProgress:(Data *) data
{
// gui updates ...
}
I have YAMessageQueue's in the main thread and the new thread so that I can
communicate both ways.
Anything wrong stand out?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden