Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
314 views
in Technique[技术] by (71.8m points)

ios - Thread error in IBAction while overriding prepareForSegue function

I'm getting a thread error Thread 1: Breakpoint 1.1 in my IBAction function. The code runs without error, but when I click the button on the simulator, the simulator crashes and produces the breakpoint error. The affected code is:

@IBAction override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
    if testoEsercizio.text == "Per iniziare premi la tv" {
        var viewController : SecondoSchermo = segue.destinationViewController as SecondoSchermo
        viewController.stringaponte = "SI buono"
    } else {
        var viewController : SecondoSchermo = segue.destinationViewController as SecondoSchermo
        viewController.stringaponte = "NON buono"
    }  
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Open the breakpoint editor in Xcode with ? + 7. From there you can see the breakpoints that are on (as indicated by dark blue) or off (with light blue). I highly suspect that you have a breakpoint set in your method.

The term Thread 1: Breakpoint 1.1 is the debugger's internal name for the breakpoint (I Assume you're reading this from the green bar of text?). It doesn't necessarily mean it is a threading error, it's just telling you where it stopped.

You can press ^ + ? + Y to Continue, or go to the Debug Menu and select other options. ? + ? + Y will bring up the Debug area and a bar of buttons which correlate to the Debug Menu's actions.

HTH

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...