I have this strange issue. When I run application from Xcode (even on device), it works fine without any crash. But as and when I run it on device without Xcode, it crashes when I navigate back from one of the viewController. I am not able to get the reason for crash as I can't use log. Has someone experienced this before?
-
2where app is crash ,please use NsLog and check in device consoleDeepesh– Deepesh2012-05-10 10:19:05 +00:00Commented May 10, 2012 at 10:19
-
It says - Segmentation fault. What might be the issue?Nitish– Nitish2012-05-10 10:30:43 +00:00Commented May 10, 2012 at 10:30
-
you can try logging to file: sume suggestions here - stackoverflow.com/questions/7271528/nslog-into-fileRok Jarc– Rok Jarc2012-05-10 11:23:28 +00:00Commented May 10, 2012 at 11:23
4 Answers
I recently experienced this after adding an MKMapView to the Storyboard. It ran perfectly when the device was attached to Xcode, but crashed when running without being connected to the computer.
The mistake I made was not checking the Embedded Frameworks.. the app was trying to load the MKMapView without having the MapKit framework imported.
The best way to diagnose this though, is to check your crash logs on the device you're using and you'll get a better understanding on what caused it
Comments
I am not able to get the reason for crash as I can't use log.
Open the Xcode organiser window, there's a section called "Device Logs" for each of your devices. A crash log is produced each time an application crashes. If you look at the console, you will also see anything you've logged with NSLog.
1 Comment
A solution to see what happens could be to download this app and see the logs/warnings. Or just open the Organizer and see the console of your device.
Comments
Sometimes "Segmentation fault" occurs when any of your UI element or any other instance gets autoreleased. You can enable zombies to look out for your allocation/deallocation. You can also use "Instruments" ('Allocation' template) tool to see the allocation/deallocation/retain/release of objects and it will give you the backtrace at the point of allocation.
There is a fair chance that any of your UI element instance is not getting retained.
It would have been more helpful if you can post the device logs too.