views:

314

answers:

3

The iPhone app I am developing has a strange quirk where it runs ok when xcode has launched it, but not when launched directly on the device.

I've checked the crash logs and the exception seems to be occurring in libxml2.2 in xmlParseCharData. It's quite a big xml document that is being parsed so I think that might be the problem.

I tried with a smaller xml document and this was fine. So either it is the size of the document or something in the document that is causing it but the same large document is parsed ok when launched via xcode.

Any ideas why this would be happening or how I might start trying to debug it?

+3  A: 

I found the problem. The app was taking too long to start. I eventually noticed in the console log in organizer that this was the problem. I changed the app so it has a proper landing screen and it works fine now.

Ian1971
A: 

I'm having a similar problem. My app is crashing when the device is not connected to Xcode but does not crash when it is run through Xcode on the device. Do you have any insight into why it would crash when taking too long to start?

My guess is that the device has some sort of timeout on program startup. I wasn't able to find documentation on it though. Are you getting a message to that effect in the device console log?
Ian1971
No, nothing useful in the device console log unfortunately. Or at least useful to me. If you have experience looking at these maybe you could take a look at my post? http://stackoverflow.com/questions/1485234/crashing-app-when-device-not-connected-to-xcode? It would be much appreciated.
A: 

I found a Apple Technical Q&A about this issue. http://developer.apple.com/iphone/library/qa/qa2009/qa1592.html

Kenji