1

My Swift app only seems to crash with EXC_BAD_ACCESS when my app is connected to XCode and I'm debugging. If I unplug my device and then run the app, it works flawlessly.

The app crashes at:

class AppDelegate: UIResponder, UIApplicationDelegate {

I'm pulling my hair out trying to solve this.

Walee
  • 59
  • 3

4 Answers4

3

It's probably not a crash. More likely you have an Exception breakpoint and you're hitting it.

matt
  • 515,959
  • 87
  • 875
  • 1,141
0

Try to replace your function with below one:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {}

or

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]!) -> Bool {} 
Sohil R. Memon
  • 9,404
  • 1
  • 31
  • 57
0

That could be a pointer deallocating issue in the memory. That would be great if you can post more details about the error/crash info that you got, so that we can help you better. There are some solutions that you can try from this existing post, which was the similar problem(EXC_BAD_ACCESS) as you have: http://loufranco.com/blog/understanding-exc_bad_access

Ares Li
  • 603
  • 1
  • 7
  • 19
0

After a fiddling with the initial view controller I found that it only happened on the controller where my GMSMapView was. As it turns out, another user was having a similar problem here.

It turns out upgrading to iOS 8.4 solved the issue immediately. While I didn't use Dave's brilliant work around, I still give all the props and kudos to him!

Thank you everyone for sticking with me during this dark time in my life.

Community
  • 1
  • 1
Walee
  • 59
  • 3