NSLog输出未在XCode 5.0.2中显示

时间:2014-01-18 11:20:09

标签: ios iphone objective-c xcode5 osx-mavericks

我在XCode 5.0.2上使用OSX Mavericks。只要按下按钮,我的代码中就会有NSLog。但NSLog的输出未显示在输出窗口中。我选择了“所有消息”。我附上了我的屏幕截图。

我该如何解决这个问题?

谢谢

//
//  RSViewController.m
//  CoffeeApp
//
//  Created by Raza Sayed on 18/01/14.
//  Copyright (c) 2014 Raza Sayed. All rights reserved.
//

#import "RSViewController.h"

@interface RSViewController ()

@end

@implementation RSViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)calculateButtonPressed:(id)sender {
    NSLog(@"Calculate Button Pressed");
}
@end

enter image description here

1 个答案:

答案 0 :(得分:2)

您的按钮似乎存在绑定问题。

在Interface Builder / Storyboard中检查按钮是否绑定到calculateButtonPressed操作方法。为此:转到IB中的按钮,单击它,然后在Utilities窗格中转到Connection Inspector(或者短按cmd-opt-6)。