Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

thread and run loop



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.