开发者

Built and ran this simple console app, but don't see anything?

开发者 https://www.devze.com 2023-02-02 04:43 出处:网络
#import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    // insert code here...
   开发者_StackOverflow社区 NSLog(@"Hello world!");
    [pool drain];
    return 0;
}

I'm using xcode, and when I build and run I don't see the output.

Is it opening and closing really fast?


You have to display the Console window manually via Run -> Console or Shift + Cmd + R


Yes it is. When doing stuff like this, I generally put a breakpoint on the [pool drain] line, and Build and Debug. Then my log messages show up in the Console. :)

0

精彩评论

暂无评论...
验证码 换一张
取 消