• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to Delay, Wait, Pause...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to Delay, Wait, Pause...


  • Subject: Re: How to Delay, Wait, Pause...
  • From: Peter Burtis <email@hidden>
  • Date: Sun, 25 May 2008 02:55:46 -0400

NSThread has a sleepUntilDate: class method.

In the example below, 0.1 = 1/10th of a second.

	NSDate *future = [NSDate dateWithTimeIntervalSinceNow: 0.1 ];
	[NSThread sleepUntilDate:future];

-Pete


On May 25, 2008, at 2:45 AM, Steve Steinitz wrote:

Hello,

This is hard to google for because they are such common words:

how do I delay, wait, pause for a tenth of a second?

I don't want to use NSTimer because I just want to resume where I left off. I don't want to be in a tight loop because I need the system to finish something. I just want to pause execution for a short time. I think there was a wait() in OS9. I found a wait() in wait.h but it wants an int * and made me nervous.

Specifically, when I send a fetch message to an NSArrayController, it sometimes takes a fraction of a second for its selection to become valid. Currently I fire an NSTimer to call a 'part 2' method to finish what I am doing (scrolling the selection into view), but it lacks niceness.

Thanks,

Steve

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
@glossysheep.com


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How to Delay, Wait, Pause...
      • From: Steve Steinitz <email@hidden>
References: 
 >How to Delay, Wait, Pause... (From: Steve Steinitz <email@hidden>)

  • Prev by Date: Spaces causes sheet to go behind parent window
  • Next by Date: Re: Core Data dynamic attributes and fetching
  • Previous by thread: How to Delay, Wait, Pause...
  • Next by thread: Re: How to Delay, Wait, Pause...
  • Index(es):
    • Date
    • Thread