XCode help?


Recommended Posts

Hey guys,

I'm learning Java at the moment, and our university teaches the course in the BlueJ IDE. It's an easy to use IDE for Java, but I'de really like to try and use XCode. I have a couple of questions.

What project would I need to select for a simple terminal based Java application?

How do I make objects, and input parameters?

Link to comment
Share on other sites

If you want to make a simple command line in Java create a new project and select "Java Tool" under the java section.

By creating a new object I'm going to assume you mean files (because if you haven't learned it already your Java class should cover objects and other object oriented design elements some time). To create a new file simply go to File->New File... and select "Java Class" under the "Pure Java" section.

Finally by input parameters I'm going to assume you mean command line arguments. In the left-hand pane there of the main Xcode windows (which won't appear until you have created your project) there should be a section labeled "Executables." Expand that and you should see your executable file (which won't appear until you have run build on your project at least once) and Ctrl+Click on the executable.

From the submenu select "Get Info" and a new windows will appear. There should be a tab labeled "Arguments" and you can add in command line arguments from here.

I hope that helps.

Link to comment
Share on other sites

Hey guys,

I'm learning Java at the moment, and our university teaches the course in the BlueJ IDE. It's an easy to use IDE for Java, but I'de really like to try and use XCode. I have a couple of questions.

What project would I need to select for a simple terminal based Java application?

How do I make objects, and input parameters?

586753996[/snapback]

Which university are you at? I am 1st year CIS student at University of Bath

I am in a similar position and decided to ditch BlueJ in favour of XCode.

Link to comment
Share on other sites

Xcode is located on the Mac OS X CD. All you have to do is put the CD in and install the developer tools which will create a new folder one your system called Developer which Xcode will be located in (also Xcode may already be installed so check to see if there is a Developer folder on your drive before installing).

You can also download the latest version of Xcode here...

http://developer.apple.com/tools/

Do note you will need to register an Apple Developer Connection account which is free.

Once you have it installed you can do the steps I mentioned above to create Java projects and class files.

Link to comment
Share on other sites

Which university are you at? I am 1st year CIS student at University of Bath

I am in a similar position and decided to ditch BlueJ in favour of XCode.

586762719[/snapback]

I'm a first year Economics and Maths student at Kent University :-)

Add me to your iChat and we can talk XCode together :-)

mattwilko

Link to comment
Share on other sites

Which university are you at? I am 1st year CIS student at University of Bath

I am in a similar position and decided to ditch BlueJ in favour of XCode.

586762719[/snapback]

I'm a first year Economics and Maths student at Kent University :-)

Add me to your iChat and we can talk XCode together :-)

mattwilko

Link to comment
Share on other sites

If you want to make a simple command line in Java create a new project and select "Java Tool" under the java section.

By creating a new object I'm going to assume you mean files (because if you haven't learned it already your Java class should cover objects and other object oriented design elements some time).? To create a new file simply go to File->New File... and select "Java Class" under the "Pure Java" section.

Finally by input parameters I'm going to assume you mean command line arguments.? In the left-hand pane there of the main Xcode windows (which won't appear until you have created your project) there should be a section labeled "Executables."? Expand that and you should see your executable file (which won't appear until you have run build on your project at least once) and Ctrl+Click on the executable.

From the submenu select "Get Info" and a new windows will appear.? There should be a tab labeled "Arguments" and you can add in command line arguments from here.

I hope that helps.

586761022[/snapback]

BlueJ allows you to make objects of a given class, and input parameters of someMethod(int y, int x) rather simply. Is there a better way to do this other than setting up arguments of the executables launch in XCode?

Edited by Knight'
Link to comment
Share on other sites

BlueJ allows you to make objects of a given class, and input parameters of someMethod(int y, int x) rather simply. Is there a better way to do this other than setting up arguments of the executables launch in XCode?

586805264[/snapback]

I've never used BlueJ before so I'm not exactly sure what you are refering to. But if you just want to make objects then you can ignore everything I said about input paramters.

By the sounds of it you want an easy want to create an instance of a class and test it's methods. The simplest way to do this is to create an instance of the said class in the main method and pass in any parameters you desire to the methods you want to test.. For example if you wanted to create a method called testMethod(int, int) that was in the class Test you would do something like this...

public static void main(String[] args) {
     test = new Test();
     test.testMethod(0, 1);
}

But Xcode, as far as I know, doesn't have much in the way of allowing you to just create an object out of the blue and test the methods. You have to do via using code.

And since you mentioned iChat let me just say feel free to contact me via iChat and I'll help you out as much as I can.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.