We can use scheduleUpdate
or schedule:@selecotr(xxx)
to schedule a method to run.
Is the scheduled method run in another thread?
No. Cocos2d objects are not thread-safe and expected to run on main thread. The timer is scheduled on the main run loop. So do not block main thread under any circumstance.
You can use [self performSelectorInBackground:…] and similar NSObject methods.
The usual caveats apply. Almost every property in cocos2d is marked "nonatomic" and is therefore not thread-safe, so you may run into common multithreading issues unless you know exactly what you're multithreading, and why you're doing it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With