• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
help w/ async message queue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: QR Code Reading Library...
  • Next by Date: shell script in AppleScript ?
  • Previous by thread: QR Code Reading Library...
  • Next by thread: Re: help w/ async message queue
  • Index(es):
    • Date
    • Thread