Reputation: 2268
is there any equivalent function to thread::yield() in the iOS 4.2 ?
for ()
{
thread::yield();//go track other events
}
I tried to use NSRunLoop
but I'm beginner and I'm not full aware of it.
Thanks in advance.
Upvotes: 0
Views: 144
Reputation: 8339
In general, just do the work you want in a thread. Let the OS schedule things.
It's also easier not to explicitly use threads, but instead use Grand Central Dispatch in some form — NSOperationQueue is a good way to do so.
Upvotes: 0
Reputation: 60549
Not directly, but you could use the NSThread
method sleepForTimeInterval:
with a very small interval to do effectively the same thing.
Upvotes: 1