The CarbonCore/OSUtils.h has been deprecated in Mac OS X 10.8. I was using the Delay() from it. Now, I need to replace with Cocoa equivalent. I think [[NSRunLoop currentRunLoop] runUntilDate:] can be a replacement. Please suggest what would be the best replacement for the same. Thanks a lot.

有帮助吗?

解决方案

I am simply using Delay() for making half-a-second delay.

The equivalent would be the usleep function, declared in unistd.h.

Delay suspends a thread. A run loop is not needed if you don't need to handle events on that thread in the meantime.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top