samedi 25 juin 2016

App crashes at segue (breakpoint occurs at prepareForSegue)

Update: I figuire out, it's very hard to debug just by reading through the code, especially in a situation like this,https://www.dropbox.com/s/ty3clsvgednzevj/LoaferMap%20for%20iPhone%20copy%202.zip?dl=0, so I upload my project to dropbox if you want to check it out. I deleted destination.delete(self), now it's gone. But the app still crashes. I realized the problem in SliderViewController maybe the code I wrote is simply unexcuteable. I'm a beginner, new to swift programming language. Your help means a lot to me. 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. My app crashes when I'm about to transition form one view to the next. 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 } More source code in the VC, and next VC, you can check another question I asked How to Pass Data from View Controllers?.

Aucun commentaire:

Enregistrer un commentaire