Re: ask about sleep function
Re: ask about sleep function
- Subject: Re: ask about sleep function
- From: Tim Trautmann <email@hidden>
- Date: Sun, 28 Jul 2002 22:24:41 -0700
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.