Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Caleb Kleveter
Treehouse Moderator 37,862 PointsHow do I see my output in Xcode?
I'm having trouble seeing the output for the code I've written in Xcode. I thought I was supposed to click on build and run button but that only debugs it. I'm using version 5.1.1. Thanks.
8 Answers

Nicholas Vandenbroeck
4,599 PointsNSLog("This is a message in the console.");
Do you use this method?

Caleb Kleveter
Treehouse Moderator 37,862 PointsI haven't learned that yet. What should I do with it?

Nicholas Vandenbroeck
4,599 PointsThis method can output messages and variables to the console. This helps to debug and understand your code.

Caleb Kleveter
Treehouse Moderator 37,862 PointsAm I supposed to put that In my Code? Where?

Nicholas Vandenbroeck
4,599 PointsWhat do you exactly mean by outputting your code?
You can put that line anywhere in your code.

Caleb Kleveter
Treehouse Moderator 37,862 PointsSorry if I got the term wrong. In the videos Mr. turner clicks on the play button to see what the out put of the code is, if thats how you'ed say it.

John Beatty
7,125 PointsThere are two code "outputs" - what users see (displayed in the iOS simulator program that XCode launches when you build and run your program) and the log console, which lets you as the developer follow and debug the program by using different means, one of which is the NSLog method. To show the console log in XCode, look to the upper right of the XCode window and click the icon of a box with a filled bottom half to toggle the console window at the bottom of the XCode frame.
Once you have that toggled, you will see NSLog messages outputted there.
An easy example is to add a " NSLog(@"view loaded") " line to a viewDidLoad method of a viewController, so when the app loads the controller, the console will output the "view loaded" message.
I'm not sure which course you are on, but hope this helps.

Caleb Kleveter
Treehouse Moderator 37,862 PointsI believe I mean the iOS simulator; right now I am working on the second badge in Obj-C Basics.