iOS4 hangs for several seconds or more when testing on device

Like most everyone else on here, I am attempting to develop an iPhone application using this SDK. I created an app shell consisting of a main menu and four additional screens using the director class to switch between them. When I test the application using the Corona simulator and the iOS (x-code) simulator, everything seems to work rather seamlessly however, when I build and test the app on my iPhone 4, I’m experiencing an unusual issue:

The app loads on the phone and runs as it does in the simulator however, when I suspend the app or click the home button, iOS seems to hang for several seconds (i.e. is unresponsive to touch, drag, etc). After that period, it frees up and iOS becomes responsive to input. This happens anytime I am in my app and attempt to return to the home screen.

Any suggestions on what could be causing this?

My code is quite bare as it’s just a shell so there’s not much logic yet. I can also provide more details if necessary.

Thanks. [import]uid: 15934 topic_id: 5306 reply_id: 305306[/import]

Just out of curiosity since I don’t have an iPhone 4 myself, does this happen with any of the sample apps or only with your code? [import]uid: 12108 topic_id: 5306 reply_id: 17621[/import]

Good question. I did build and install a few of the sample apps including the sample app provided by the director class author. None of those experienced the same issues that my app is. [import]uid: 15934 topic_id: 5306 reply_id: 17622[/import]

In that case you should post your code. Since the issue you are experiencing is specific to your code we’ll need to see it. Off the top of my head, I’m guessing you accidentally put an infinite loop in your code that hangs for a bit until it times out. [import]uid: 12108 topic_id: 5306 reply_id: 17634[/import]

Ok well you managed to help- indirectly. Since the problem must be specific to my project, I tried looking around for something that might either cause a loop (which there wasn’t) or something that was inherently different between the samples and my own app. Turns out, I had a iOS plist entry in my build.settings (UIApplicationExistsOnSuspend=false) that for some reason was causing this issue. Once I removed it, exiting the application seems to work properly now on the device.

Thanks :slight_smile:

For future reference, do you or anyone else out there commonly experience inconsistent app behavior (aside from FPS or performance) when running a build on the corona simulator, iOS simulator, or actual device. I’m just wondering how often I can rely on the simulators vs. building for the device frequently. [import]uid: 15934 topic_id: 5306 reply_id: 17650[/import]

Glad you figured it out, I’ve never seen that setting before.

There are a number of differences between simulator and device mentioned on the forum. One difference that bit me right away was case sensitivity: the simulator doesn’t mind mistakes in capitalization in filenames, but device will crash. [import]uid: 12108 topic_id: 5306 reply_id: 17677[/import]