I get nothing when I debug despite "build succeeded"


#1

When I click on Debug AGoodStart after a successful build, nothing happens. I do not get the code being executed. The center screen just stays white. What am I doing wrong?


#2

Clicking the Debug button only enables the breakpoints. You have to click also the Build/Run button to run the program.

Click Debug button; click the Build/Run button.


#3

The book says to press the Run button - and hope for the “build succeeded” message, which I got. Then it says, “Once your build has succeeded, find the item at the top of the log navigator labeled Debug AGoodStart. Click this item to display the log from the most recent run of your program.” It is when I do this that I get nothing. The book indicates that I should get a “verbose” log. Is there some setting or other on my computer that is stymying the log?


#4

But when you run the program, do you see anything on the Console?
To display the Console: Xcode/View/Debug Area/Activate Console.


#5

No. I see the console, but it remains blank when I debug. :cry:


#6

How about creating a new Foundation project, with the following main.m file:

[code]// main.m

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[])
{
NSLog (@“Triple J FM105.5”);
return 0;
}[/code]
To see if the log Triple J FM105.5 appears on the console.


#7

Gosh. I really appreciate you trying to help me. I’m not stupid, but I am a total beginner on the programming thing. And I’m sure your advice would be a total “duh” to anyone with slightly more knowledge than me, but I don’t know what that means. I tried to take your example and copy and paste it into a new project and I got a bezillion error messages. I’m feeling kind of sad that I can’t get past chapter 2. I got everything in the lesson the right way… but it just won’t show up.


#8

Okay. Don’t be sad. Let’s have a look at what you have got there.
Can you copy and post the code in the main.c file in your project which you say builds?

In the project navigator, click on the main.c file; the contents will display in the editor view.
and it should look like this:

//  main.c

#import <stdio.h>

int main (int argc, const char * argv[])
{
    printf ("Hello World!\n");
    return 0;
}

#9

This is what I have:

//
// main.c
// AGoodStart
//
// Created by Balamuth on 6/5/12.
// Copyright © 2012 MyCompanyName. All rights reserved.
//

#include <stdio.h>

int main(int argc, const char * argv[])
{
//Print the beginning of the novel printf (“It was the best of times.\n”); printf (“It was the worst of times. \n”);/* Is that actually any good? Maybe it needs a rewrite.*/
return 0;
}


#10

I think I see your problem. // means “Ignore everything else on this line”. Break your program into separate lines and the problem will go away.

[code]#include <stdio.h>

int main(int argc, const char * argv[])
{
//Print the beginning of the novel
printf (“It was the best of times.\n”);
printf (“It was the worst of times. \n”);
/* Is that actually any good? Maybe it needs a rewrite.*/
return 0;
}[/code]


#11

Blessings on your house. Thank you.