我在我的模型中添加對象到NSMutableArray堆棧。這裏的接口:簡單的addObject到NSMutableArray方法給出lldb錯誤
@interface calcModel()
@property (nonatomic, strong) NSMutableArray *operandStack;
@end
和實現:
@implementation calcModel
@synthesize operandStack = _operandStack;
- (NSMutableArray *)operandStack;
{
if (_operandStack == nil) _operandStack = [[NSMutableArray alloc]init];
return _operandStack;
}
這ADDOBJECT法正常工作:
- (void)pushValue:(double)number;
{
[self.operandStack addObject:[NSNumber numberWithDouble:number]];
NSLog(@"Array: %@", self.operandStack);
}
但是這一個崩潰的應用程序,只是說 'LLDB' 在日誌中:
- (void)pushOperator:(NSString *)operator;
{
[self.operandStack addObject:operator];
NSLog(@"Array: %@", self.operandStack);
}
什麼是導致這個錯誤?
如果您使用當前的XCode版本開始使用Objective-C,請參閱http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_4_4.html:@synthesize不再是需要。 – alecail
如果它真的只是**說「lldb」,那麼你可能會在該行設置一個斷點......或者你正在停止一個異常斷點。 – borrrden