I have an app that has been in the store for almost four months. Yesterday I opened the project in Xcode 3.2.3 with SDK 4.01 for the first time. When I build and run the app on my 3G phone running iOS 3.1.3 everything works perfectly as it always has. When I build and run on my other 3G phone running iOS 4.01 something very strange happens.
In the app there is a scheduler to spawn balloons. I placed an NSLog at the start of the spawnBalloon method that is called by the scheduler. The scheduler is set at 1.2 seconds and it does wait that long before calling the method the first time, but after that the method gets called so extremely fast that the method never gets to execute. If I put two NSLogs at the start of the method it has time to print both of those but never makes it further. I have attached a small section of the console log that shows how insanely fast the method is being called.
2010-07-29 18:14:41.403 TQG[2252:307] start spawnBalloon
2010-07-29 18:14:41.418 TQG[2252:307] start spawnBalloon
2010-07-29 18:14:41.431 TQG[2252:307] start spawnBalloon
2010-07-29 18:14:41.447 TQG[2252:307] start spawnBalloon
2010-07-29 18:14:41.463 TQG[2252:307] start spawnBalloon
Instead of the method being called every 1.2 seconds it is being called somewhere around every 15 milli seconds which doesn't give enough time for the method to execute.
I cannot understand why this would happen only on my phone running IOS 4.01.
EDIT: I should also mention that the version in the store that was built using an older version of Xcode runs perfectly fine on ALL iOS versions. Also in Xcode 3.2.3 I am using iOS 4 as the Base SDK and building against iOS 3.