0

In Operation.h

@interface Operation : NSObject
-(float)addition:(float)number1 plusWith:(float)number2;
@end

In Operation.m

#import "Operation.h"
@implementation Operation
-(float)addition:(float)number1 plusWith:(float)number2 {
    return number1 + number2;
}
@end

In ViewController.m

#import "Operation.h"
- (void)viewDidLoad {
    [super viewDidLoad];
Operation *Math = [[Operation alloc] init];
    float doPlus = [Math addition:3.0 plusWith:4.0];
    NSLog(@"%f + %f = %f",3.0,4.0,doPlus);
}

Why runtime just return (lldb) ? Where is my error ? My debug area : enter image description here

5
  • I am getting the output | 3.000000 + 4.000000 = 7.000000 Jan 26, 2015 at 12:57
  • When it stops at (lldb) type the command 'bt' and paste what it prints into your question. Jan 26, 2015 at 13:45
  • Both thread info and bt can be illuminating.
    – Rob
    Jan 26, 2015 at 13:51
  • @AshishKakkad - thanks your mention but that's amazing !
    – ryan tran
    Jan 27, 2015 at 4:46
  • @PhillipMills and Rob : Thank you for your reply ! I have added my debug area image into question.
    – ryan tran
    Jan 27, 2015 at 4:50

1 Answer 1

0

There is no error in your code. The reason your code is stopping is that you have put a breakpoint at this line:

return number1 + number2;

A breakpoint means "stop here". The debugger is stopping there because that is what your breakpoint tells it to do.

So you can either remove the breakpoint or else, when the debugger stops at the breakpoint, you can tell it to resume running from that point.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.