On Jan 22, 2013, at 12:34 PM, Charles Srstka <cocoa...@charlessoft.com> wrote:

> int64_t delayInSeconds = 2;
> dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * 
> NSEC_PER_SEC);
> dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
>   [foo doSomethingWith:bar];
> });


Just note that the template has a bug – if you want to delay for a fractional 
number of seconds, be certain to change the type of 'delayInSeconds' to a 
floating point type.
--
David Duncan

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to