Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application crashes when not running from Xcode but works fine when run from Xcode

Tags:

xcode

ios

iphone

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?

like image 443
Nitish Avatar asked May 10 '12 10:05

Nitish


People also ask

How do I run an Xcode project on a real device?

Connect your iPhone to a macOS machine with a USB line. Then in Xcode, click Product —> Destination menu item in the top menu bar. Then select your real iPhone device in the popup menu list under the Device menu. Then you can click the Run button ( triangle button) at the top to run the app on the target iPhone.


1 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

like image 133
Declan Land Avatar answered Oct 13 '22 16:10

Declan Land