[英]MKMapView crashes the app when app is run in Xcode on a device but not if running on device by application icon tap
I have this case where I implemented MKMapView in .xib file.我有这种情况,我在 .xib 文件中实现了 MKMapView。 I connected IBOutlet in class with MKMapView in .xib file.
我在课堂上将 IBOutlet 与 .xib 文件中的 MKMapView 连接起来。 iOS on device is 8.3.
设备上的 iOS 是 8.3。 When app is build and run by Xcode on device, it crashes when I open view controller with MKMapView, but it doesn't crash if I run the application on tap on it's icon on the device.
当应用程序在设备上由 Xcode 构建和运行时,当我使用 MKMapView 打开视图控制器时它会崩溃,但如果我在设备上点击它的图标运行应用程序,它不会崩溃。 I get no exception or error in log.
我在日志中没有发现异常或错误。 It's only breaks at main.
它只是在主要中断。 I commented code for MKMapView IBOutlet but nothing changes, only if I remove MKMapView from .xib file crash is gone.
我评论了 MKMapView IBOutlet 的代码,但没有任何变化,只有当我从 .xib 文件中删除 MKMapView 时,崩溃才会消失。 Code is written in Swift.
代码是用 Swift 编写的。 How to fix this?
如何解决这个问题? Thanks for your help.
谢谢你的帮助。
Hope these points may help:希望以下几点能有所帮助:
我有同样的问题,但我解决了它,将 mapkit.framework 添加到项目中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.