thread and run loop
Subject : thread and run loop
From: Olivier Destrebecq <email@hidden >
Date: Mon, 31 Oct 2005 19:27:19 -0500
Delivered-to: email@hidden
Delivered-to: email@hidden
In my saving method for my document, i decided to offload all the
work to a thread so that the progress dialog that is displayed gets
updated.
Here is what i do to achieve this
start secondary thread
while (!doneSaving)
[[NSRunLoop currentRunLoop] runUntilDate: [NSDate
dateWithTimeIntervalSinceNow: 0.1]];
and then resume work and return. It seems to work, but i'm not sure
this is the way to do it...
is this the correct approach, should i use -run instead of -
rununtildate on the runloop?
Olivier
http://otusweb.spymac.com/home/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.