简体   繁体   中英

App crashes ONLY when connected to XCode

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.

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

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 {} 

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM