【问题标题】:NSLog output not showing in XCode 5.0.2NSLog 输出未在 XCode 5.0.2 中显示
【发布时间】:2014-02-07 19:33:35
【问题描述】:

我在OSX Mavericks 上使用XCode 5.0.2。每当按下按钮时,我的代码中都有一个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

【问题讨论】:

  • 首先在calculateButtonPressed中设置一个断点来说服它触发。

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


【解决方案1】:

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

在 Interface Builder/Storyboard 中检查按钮是否绑定到 calculateButtonPressed 操作方法。为此:转到 IB 中的按钮,单击它,然后在实用程序窗格中转到连接检查器(或短按 cmd-opt-6)。

【讨论】:

  • 谢谢,这确实是问题所在! :)
猜你喜欢
  • 1970-01-01
  • 2015-11-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-05-20
  • 1970-01-01
  • 2011-03-07
相关资源
最近更新 更多