【问题标题】:Runtime return (lldb) when implement class in xcode 6在 xcode 6 中实现类时的运行时返回(lldb)
【发布时间】:2015-01-26 12:51:06
【问题描述】:

操作中.h

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

在操作中.m

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

在 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);
}

为什么运行时只返回 (lldb) ?我的错误在哪里? 我的调试区:

【问题讨论】:

  • 我得到了输出 | 3.000000 + 4.000000 = 7.000000
  • 当它停在 (lldb) 时,键入命令“bt”并将它打印的内容粘贴到您的问题中。
  • thread infobt 都可以发光。
  • @AshishKakkad - 谢谢你的提及,但这太棒了!
  • @PhillipMills 和 Rob:谢谢您的回复!我已将我的调试区域图像添加到问题中。

标签: ios function class xcode6 lldb


【解决方案1】:

您的代码没有错误。您的代码停止的原因是您在此行放置了一个断点:

return number1 + number2;

断点的意思是“停在这里”。调试器停在那里,因为这是您的断点告诉它要做的事情。

因此您可以删除断点,或者当调试器在断点处停止时,您可以告诉它从该点恢复运行。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2014-05-24
  • 1970-01-01
  • 2015-10-28
  • 1970-01-01
  • 2015-01-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多