How to solve "Thread 1: breakpoint 1.3"?

Dear Developers,


I am a beginner, and am trying to create a very basic calculator in Xcode.


I have been getting an error that I cannot solve, even after deleting all the code and starting again.


I hope someone can help me. Below is the page where the error is showing and below that is the code I have written so far. Thank you in advance.


In the Debug area is "(lldb)" highlighted in blue.


In AppDelegate.swift:

- In bold is the line that is receiving an error message below.

- On Xcode, the line is highlighted green and says "Thread 1: breakpoint 1.3"


import UIKit


@UIApplicationMain

class AppDelegate: UIResponder, UIApplicationDelegate {


var window: UIWindow?

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

//Override point for customization after application launch.

return true

}

func applicationWillResignActive(application: UIApplication) {

// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.

// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.

}

func applicationDidEnterBackground(application: UIApplication) {

// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.

// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

}

func applicationWillEnterForeground(application: UIApplication) {

// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.

/

}

func applicationDidBecomeActive(application: UIApplication) {

// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

}

func applicationWillTerminate(application: UIApplication) {

// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.

}


}



In ViewController.swift:


import UIKit

enum modes {

case NOT_SET

case ADDITION

case SUBTRACTION

}

class ViewController: UIViewController {


var labelString:String = "0"

var currentMode:modes = modes.NOT_SET

var savedNum:Int = 0

var lastButtonWasMode:Bool = false

@IBOutlet weak var label: UILabel!


@IBAction func tapped0(sender: AnyObject) {tappedNumber(0)}

@IBAction func tapped1(sender: AnyObject) {tappedNumber(1)}

@IBAction func tapped2(sender: AnyObject) {tappedNumber(2)}

@IBAction func tapped3(sender: AnyObject) {tappedNumber(3)}

@IBAction func tapped4(sender: AnyObject) {tappedNumber(4)}

@IBAction func tapped5(sender: AnyObject) {tappedNumber(5)}

@IBAction func tapped6(sender: AnyObject) {tappedNumber(6)}

@IBAction func tapped7(sender: AnyObject) {tappedNumber(7)}

@IBAction func tapped8(sender: AnyObject) {tappedNumber(8)}

@IBAction func tapped9(sender: AnyObject) {tappedNumber(9)}


@IBAction func tappedPlus(sender: AnyObject) {

}

@IBAction func tappedMinus(sender: AnyObject) {

}

@IBAction func tappedEquals(sender: AnyObject) {

}

@IBAction func tappedClear(sender: AnyObject) {

}

func tappedNumber(num:Int) {

labelString = labelString.stringByAppendingString("\(num)")

updateText()

}


func updateText() {

guard let labelInt:Int = Int(labelString) else {

label.text = "Int conversion failed"

return

}

label.text = "\(labelInt)"

}


func changeMode(newMode:modes) {

}


override func viewDidLoad() {

super.viewDidLoad()

// Do any additional setup after loading the view, typically from a nib.

}

override func didReceiveMemoryWarning() {

super.didReceiveMemoryWarning()

// Dispose of any resources that can be recreated.

}


}

The "breakpoint 1.3" is irrelevant here, and the (lldb) is nothing more than the prompt for the debugger's command line. The reason that the instruction pointer (the green highlight) is positioned on top of your class's declaration is that there's no good place to put it, so it just ends up there. Notice that right above the class declaration is the @UIApplicationMain placeholder; that placeholder does a lot of the basic setup work for the app, including loading the storyboard and other important setup.


Most likely, something is wrong with your app's storyboard or main nib file. Try hitting the Continue button a few times and see what happens. If the instruction pointer turns red and you see something about "SIGABRT," (signal abort—in other words a fatal error) then check the debugger console to see what prints out. Post it here and I'll help you figure out what needs to happen.

Hi Bob,


I just hit run and the simulator worked with no error message... I have no idea what happened but it seems to have solved itself.. it only took 5 hours


Apprecaite you replying back and offering me assistance, hopefully it won't come back.

So it's not an error… are you sure you didn't accidentally add a breakpoint somewhere? Look at the top of your AppDelegate file to see if there's a blue arrow-like thing to the left of one of those lines of code. If there is, drag it out of its spot to delete it.


When code hits an active breakpoint, it screeches to a halt so you can see exactly what's going on. It's an incredible debugging tool, but can be a little surprising if accidentally enabled. 🙂

I actually did have abreak point on that line! I just removed it!


But it started working after I deleted line andjust pasted it back in... I am such an amature right now, but practice makes perfect!


Thanks for the help Bob 🙂

You didn't need to delete the whole line of code to remove the breakpoint—just drag the breakpoint out of the gutter on the side. In the future, when you need to add a breakpoint to test something, just click in the gutter. You can also click a breakpoint to enable or disable it.

How to solve "Thread 1: breakpoint 1.3"?
 
 
Q