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 console – Deepesh May 10 '12 at 10:19
-
It says - Segmentation fault. What might be the issue? – Nitish May 10 '12 at 10:30
-
you can try logging to file: sume suggestions here - http://stackoverflow.com/questions/7271528/nslog-into-file – Rok Jarc May 10 '12 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

- 639
- 2
- 11
- 27
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
.

- 72,985
- 14
- 101
- 108
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.

- 605
- 6
- 20