NOTE: This tutorial will be divided into two large posts.
NOTE: I won't be describing how to setup XCode. That should be pretty self explanitory, especially for anyone who's used a computer extensively.
You can get Apple's XCode from Apple Developer Connection.
You can also get it from the OS X 10.4.3 DVD.
This program, Slider, will consist of a simple window with a slider bar in the middle, and a textbox on the bottom, which shows the current number where the slider is resting on. Simple, no?
1. Make a New Project.
First, open XCode in /Developers/ . Next, File-> New Project.

Scroll down a bit in the Applications list to find "Cocoa Application." Press next.

In the Project Name box, type "Slider"(without the quotes). After, choose where you want to store the project's source code, then press Finish.

2. Learning how to use Interface Builder.
Interface Builder is what developers use to quickly make a User Interface for the user to interact with the program. It is simple to use once you get the hang of it. To open it, simply double click MainMenu.nib in your project screen.

After launching, you will see something like this(Thumbnailed to cut down on page size):

To change the size of your window, simply click it to give it focus, then grab the bottom right corner and drag it to your heart's content. In my project, I made it look something like this:

Now, let's do a few aesthetic parts with our program, namely renaming the menu bar from New App to Slider.
First, give focus to the menu bar of our program by clicking the window entitled: "MainMenu.nib (English) - Main Menu".

OK. To change where it says NewApplication, simply double click it, then type in Slider.
After, click it ONCE to open its menu. Change all instances of New Application to Slider by double clicking them, while leaving in the other words such as "Quit", or "About". Also, change the help menu to say Slider as well.
If done correctly, you should have these two shots:
1. Main Menu

2. Help Menu

Now that that's taken care of, let's actually design what our interface will look like. First, click this tab on the
Cocoa-Controls window, if you have not already:

Next, click on the slider in the middle, and drag it(while holding the mouse button down) to somewhere in your interface.
For me: here is where I placed it:

Now let's resize the slider so it fits the size of our window. Select the slider by clicking it, then grab one of the circular corners and then hold down the mouse button; drag the mouse to whatever width you want the slider to be. Here's what mind ended up looking like:

^I apologize for the crappy text editing there; I was in a rush to get to class.
After that, click the text tab, the one to the right of the buttons/sliders tab, and then drag a text box(the one under System Font Text) onto your interface whereever you want:

Now click the slider, HOLD ctrl, and HOLD down the mouse button, and then DRAG a line down to the text box:

When the Inspector pops up, choose takeIntValueFrom, on the Target/Actions tab, then press connect, and close it:

When you finish this, save your interface, and quit Interface Builder. Next, compile your program(run and build button), and be amazed as your program reports what percent the slider sits on when you stop moving it!


