Where is my NSLog output? Where is my NSLog output? xcode xcode

Where is my NSLog output?


Make sure you have your Console activated. To do that, you can:

  • Go to View > Debug Area > Activate Console (From your Menu Bar)
  • Or press C on your keyboard


NSLog() output on the simulator does indeed show up in the Console Mac OS X application.

Go to All Messages and then filter based on your app name to get rid of the fluff, and run again. You'll see it in your output if the NSLog code is actually being hit during the execution of your program.


Use NSLog() like this:

NSLog(@"The code runs through here!");

Or like this - with placeholders:

float aFloat = 5.34245;NSLog(@"This is my float: %f \n\nAnd here again: %.2f", aFloat, aFloat);

In NSLog() you can use it like + (id)stringWithFormat:(NSString *)format, ...

float aFloat = 5.34245;NSString *aString = [NSString stringWithFormat:@"This is my float: %f \n\nAnd here again: %.2f", aFloat, aFloat];

You can add other placeholders, too:

float aFloat = 5.34245;int aInteger = 3;NSString *aString = @"A string";NSLog(@"This is my float: %f \n\nAnd here is my integer: %i \n\nAnd finally my string: %@", aFloat, aInteger, aString);