If I make a simple Xcode project in cocos2d I’ve always wondered what happens in the following situation:
Method A is scheduled every 0.01 seconds
Method B is scheduled every 1 second
Now suppose method B is a large method and takes a moment to compute. Will it EVER be interrupted by method A?
In other words, will a method always complete before another one starts?
I havn’t created threads or anything.
In general, when you’re scheduling stuff in the UI thread of a UI application, once a specific operation is started, it’s not interrupted (except for errors). This holds not only for iOS, but for most UI platforms.
The system may interrupt the UI thread to handle hardware interrupts (or, eg, interrupts due to received cell signals), but those interruptions would be (mostly) “transparent” to the application.
But you’ll never be interrupted by your own operations.