Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacProgrammer247

macrumors newbie
Original poster
Nov 19, 2015
9
0
Hi,

I've only recently started learning Swift programming and my first hurdle is that I cannot get the program to print to the console in x-code? When I press command/shift/C the cursor goes to the output section of x-code but nothing happens. Sorry I'm an absolute beginner. Any help would be appreciated...

Here is my code:
Code:
import UIKit


class ViewController: UIViewController {


    overridefunc viewDidLoad() {

        super.viewDidLoad()

        print("Hello,World!")

        //print("Hello", terminator: "")

    }


    overridefunc didReceiveMemoryWarning() {

        super.didReceiveMemoryWarning()


    }



}
 
Last edited by a moderator:
On which version of swift are you working? Is your ViewController set to the initial ViewController?
 
I'm not sure. I started a new project in x-code and chose Swift. I have the latest x-code installed and I'm assuming it's the latest version of Swift. I'm not sure about the veiw controller. How would I check that?

TIA
 
I've got no idea what you're talking about sorry?

I'm sure there's a really simple solution that I'm missing but could you please explain what you mean? I'm totally new to this x-code environment.
 
I've got no idea what you're talking about sorry?

I'm sure there's a really simple solution that I'm missing but could you please explain what you mean? I'm totally new to this x-code environment.
perhaps it's better to first engage in some tutorials
At the moment you're lacking some basic knowledge
 
All I'm trying to do is get it to print to the output area? I'm doing exactly what it says to do in a book for beginners but for the life of me cannot get it to print anything. I have no problem understanding the code so far I just can't understand why it's not outputting anything?

Is there some tutorial out there that shows all the settings and stuff? Not sure why this sort of thing isn't more intuitive.
 
All I'm trying to do is get it to print to the output area? I'm doing exactly what it says to do in a book for beginners but for the life of me cannot get it to print anything. I have no problem understanding the code so far I just can't understand why it's not outputting anything?

Is there some tutorial out there that shows all the settings and stuff? Not sure why this sort of thing isn't more intuitive.
there are plenty of them
which languages do you speak
 
no I mean English and so. You can also upload your file if you put the map in a zip
 
bitfountain has a free starting course showing you the several first steps
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.