Re: Something like runUntilDate in CoreFoundation
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