On Thu, Apr 10, 2008 at 11:14 AM, Don Arnel <[EMAIL PROTECTED]> wrote:
> I thought maybe there was a simple message I could send to NSApp, but it
> looks like putting the loop in a new thread is the way to go.  Thanks!

Likely throwing this loop off to an NSThread is the cleanest and most
efficient solution (allows UI to respond and the simulation to run
concurrently, most Macs are at least dual core these days).

You can inform your UI of work status, etc. by using -[NSObject
performSelectorOnMainThread:withObject:waitUntilDone:] since you
(normally) want to manipulate Cocoa UI on while running in the context
of the main thread.

You could attempt to run the work loop periodically in your simulation
loop if you don't want to use a secondary thread. Look at the docs for
NSRunLoop.

Also I suggest you review...
<http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/Introduction/chapter_1_section_1.html>

-Shawn
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to