iPhone app simple calculator - objective c error

2019-09-12 03:20发布

问题:

i'm new in iOS developing and the objective c. so i want to start with a simple app. i'm trying to make an app for a play cards game that records the score each round. so it just adds up each team (two teams ) score. in the app interface there will be three buttons and two text fields to add the scores and a text view to see all the scores recorded.

so now i'm on the record method n i get a runtime error after pressing record in the iPhone simulator :

- (IBAction)record:(id)sender {
  //  NSString *slna = lna.text;
   // NSString *slhm = lhm.text;
    int x, y, resultx, resulty;
x  = [lna.text integerValue];
y  = [lhm.text integerValue];
resultx = 0;
resulty = 0;
resultx= resultx+x;
resulty= resulty+y;
alnashrah.text = [NSString stringWithFormat:@"%d      %d", resultx,resulty];    

the error message i get : " Thread 1 : breakpoint 2.1 "

回答1:

IF that is all the information the console is telling us, this is not an error message, it means you added a breakpoint. Beside your code, you will see a gutter line, if you press it you can add breakpoints which are these blue arrow things. Here is an image:

So to unselect the breakpoint, just click it or right click it and press delete.

Also to disable breakpoints: command+Y or press the breakpoints select button at the top near the stop button and the scheme bar and the build status bar



标签: iphone ios xcode