Re: Reponsiveness of application
Re: Reponsiveness of application
- Subject: Re: Reponsiveness of application
- From: Chris Hanson <email@hidden>
- Date: Sun, 27 Apr 2003 13:59:04 -0500
You have a few options.
* Use an indeterminate progress bar and tell the progress bar to use
threaded animation. This will cause a barber-pole effect in the
progress bar, making it obvious your application is doing something,
but it won't make the application responsive.
* Split your processing off into a thread, and periodically update an
instance variable from that thread (protected by a lock of course)
indicating how far it's gone. Then you can use an NSTimer to
periodically update your progress bar while processing is taking
place. This lets you make your application responsive, including
giving you the ability to implement a "Cancel" button.
* Process your data in small chunks and drive the processing from an
NSTimer or using -performSelector:withObject:afterDelay:. Since this
is driven from your application's run loop, your application can also
do other things while it's going on.
-- Chris
--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.