This problem has driven me crazy, it’s been 5 days I’m trying to solve it. Here I am, desperate for a solution.
I am developing a simple game on Cocos2d. A loop method : -(void)update:(CCTime)delta gets called every specific interval of time.
This thing started happening just 5 days ago and god knows why. At any random point in the middle of the game loop, around 10 seconds (could vary from 5 to 20 secs) after the beginning of the game loop, it will just freeze, for no apparent reason. Instruments won’t detect anything, debugger won’t notice a thing. All I noticed is that the loop stops being called. No memory problem, or anything related to it.
the
There’s no specific method called that’s driving that freeze, which is being completely random. Same thing happens on iPhone, iPad, iPod touch, wether its the only app running or not, and wether its iOS 4.0 or 5.0… There are absolutely no leaks detected from instruments, no Zombie objects either.
I repeat, this is not a crash, just a freeze in the game loop.
PS: the music still runs in the background even though the graphics are frozen.
I am on Xcode 4.2 with iOS 5.0 and Cocos2d 1.0.1, running my game on iPad 1, iPhone 4, 3GS and iTouch 3g all of them on iOS 5.0.1. Same freeze….
Any ideas? PLEASE HELP!
Well, i know a sure fire way of ‘stopping’ all graphic processing with coco (ver 99.4), whilst the touch handling mechanisms are still perfectly working. I just checked back in an older version of a project and here it goes:
I just added this method in one of the combat scene wrapup and exit scenes, and sure enough. What i get is a dead stall, no exception whatsoever, music and touch handling still working. The log still shows that my touch processing routines are handled AND called back. This had me stomped for a long bit, and i now “pattern” myself out of similar obvious mistake. If something like this happens in any one of your threads, the app will give you the ‘freeze’ bit. Hope you can find your root cause.