简体   繁体   English

仅当连接到XCode时,应用程序才会崩溃

[英]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. 当我的应用程序连接到XCode且正在调试时,我的Swift应用程序似乎EXC_BAD_ACCESS而崩溃。 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. 您更有可能有一个Exception断点,并且您遇到了它。

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 您可以从此现有帖子中尝试一些解决方案,这与您遇到的问题类似(EXC_BAD_ACCESS): 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. 摆弄初始视图控制器后,我发现它仅发生在我的GMSMapView所在的控制器上。 As it turns out, another user was having a similar problem here. 事实证明,另一个用户在这里遇到了类似的问题

It turns out upgrading to iOS 8.4 solved the issue immediately. 事实证明,升级到iOS 8.4立即解决了该问题。 While I didn't use Dave's brilliant work around, I still give all the props and kudos to him! 尽管我没有使用Dave的出色工作,但我仍然把所有的道具和荣誉都给了他!

Thank you everyone for sticking with me during this dark time in my life. 谢谢大家在我生命中的黑暗时期与我在一起。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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