• 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: Something like runUntilDate in CoreFoundation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Something like runUntilDate in CoreFoundation


  • Subject: Re: Something like runUntilDate in CoreFoundation
  • From: Chris Kane <email@hidden>
  • Date: Wed, 10 Aug 2005 08:27:15 -0700

CFRunLoopRunInMode() in a simple loop is the answer. Something like ....

CFAbsoluteTime endTime = ...
do {
// This might be a good place for an autorelease pool
SInt32 result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, endTime - CFAbsoluteTimeGetCurrent(), true);
// This might be a good place to release the autorelease pool
if (kCFRunLoopRunFinished == result) break;
if (kCFRunLoopRunTimedOut == result) break; // redundant with the do-loop check
} while (CFAbsoluteTimeGetCurrent() < endTime);



Chris Kane Cocoa Frameworks, Apple


On Jul 19, 2005, at 7:24 PM, Mark Williams wrote:

Is there anything like the NSRunLoop runUntilDate in the core foundation. I have a plain old c function that runs a loop and I need to be able to detect button clicks (for a cancel) while that is happening. I sure could use some one pointing me in the right direction. Thanks,
Mark.


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: RESEND: NSMetadataItem performance issues
  • Next by Date: Text Field Limits and Undo
  • Previous by thread: Re: Help Viewer not scrolling to anchors: Workaround
  • Next by thread: Text Field Limits and Undo
  • Index(es):
    • Date
    • Thread