iOS 应用程序在 segue 崩溃(断点出现在 func prepareForSegue 处)
iOS App crashes at segue (breakpoint occurs at func prepareForSegue)
更新:我发现,光靠阅读代码很难调试,尤其是在这种情况下,https://www.dropbox.com/s/ty3clsvgednzevj/LoaferMap%20for%20iPhone%20copy%202.zip?dl=0,所以我把我的项目上传到dropbox如果你想重现错误。
我删除了destination.delete(self),现在没了。但是应用程序仍然崩溃。我意识到 SliderViewController 中的问题,也许我编写的代码根本无法执行。我是初学者,swift 编程语言的新手。你的帮助对我来说意义重大。
If you download my project, and look at it. My goal is actually pretty straightforward, you use a slider to select a travel radius, and there are long lines of code generates a random location based on my current location. And finally pass that code to destinationViewController, to display a flyover animation based on the new generated location. But right now I think everything is set up correctly, but the app still crushes.
当我要从一个视图转换到下一个视图时,我的应用程序崩溃了。
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if (segue.identifier == "sendLocationdata") {
let destination = segue.destinationViewController as! DestinationViewController
Thread 1, Breakpoint 1.1
destination.latitude = latitude
destination.longitude = longitude
}
更多源代码在VC,下一个VC,你可以查看我问的另一个问题。
segue.destinationViewController
不是 destinationViewController
这个 class 是一个 UINavigationController
你必须给 UINavigationController 的 rootViewController 设置经纬度
请这样编辑
更新:我发现,光靠阅读代码很难调试,尤其是在这种情况下,https://www.dropbox.com/s/ty3clsvgednzevj/LoaferMap%20for%20iPhone%20copy%202.zip?dl=0,所以我把我的项目上传到dropbox如果你想重现错误。 我删除了destination.delete(self),现在没了。但是应用程序仍然崩溃。我意识到 SliderViewController 中的问题,也许我编写的代码根本无法执行。我是初学者,swift 编程语言的新手。你的帮助对我来说意义重大。
If you download my project, and look at it. My goal is actually pretty straightforward, you use a slider to select a travel radius, and there are long lines of code generates a random location based on my current location. And finally pass that code to destinationViewController, to display a flyover animation based on the new generated location. But right now I think everything is set up correctly, but the app still crushes.
当我要从一个视图转换到下一个视图时,我的应用程序崩溃了。
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if (segue.identifier == "sendLocationdata") {
let destination = segue.destinationViewController as! DestinationViewController
Thread 1, Breakpoint 1.1
destination.latitude = latitude
destination.longitude = longitude
}
更多源代码在VC,下一个VC,你可以查看我问的另一个问题
segue.destinationViewController
不是 destinationViewController 这个 class 是一个 UINavigationController
你必须给 UINavigationController 的 rootViewController 设置经纬度
请这样编辑