Re: ask about sleep function
Re: ask about sleep function
- Subject: Re: ask about sleep function
- From: "Chong Hiu Pun" <email@hidden>
- Date: Mon, 29 Jul 2002 14:17:24 +0800
Thanks, actually I want to show progress in progress bar, however it is so
fast that the user cannot see the bar moving.As a result, how can I start
the progress bar and make it slower in another thread instead of using the
sleep function?thanks!
----- Original Message -----
From: "Tim Trautmann" <email@hidden>
To: "Chong Hiu Pun" <email@hidden>; <email@hidden>
Sent: Monday, July 29, 2002 1:24 PM
Subject: Re: ask about sleep function
>
On 7/28/02 21:41, "Chong Hiu Pun" <email@hidden> wrote:
>
>
> In cocoa, is there a function similar to sleep? e.g I want the program
to
>
> pause for 2 seconds.Thanks!
>
>
Even though I don't think it is a good idea using the sleep function in
>
Cocoa GUI apps. It will work just fine in Cocoa code. Give it a try IF
this
>
is really what you want. Unless you are writing a non-GUI app, I doubt
sleep
>
is what you are looking for and sleep will be detrimental to your user
>
experience.
>
>
Sleep suspends execution of your program for the specified amount of time.
>
Issuing a sleep in a GUI Cocoa Application will most definitely give you
the
>
beach ball icon for the duration of your sleep and your GUI won't respond
to
>
user actions until the execution of your program continues.
>
>
Without knowing what problem you are trying solve I can only speculate.
>
Maybe NSNotification, NSTimer or NSThread can help you solve it?
>
>
Tim
_______________________________________________
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.