How to Make a Simple Program With Xcode

Ever wondered how everyone makes those great programs? Read on to find out how... Open Xcode. You may not have Xcode on your system, in that case, install it with the developer tools CD that should have come with your computer.

Table of Contents
Method 1 of 1:

Snow Leopard and Later

  1. images 1 of How to Make a Simple Program With Xcode
    Images 1 of How to Make a Simple Program With Xcode
    Beginning with Snow Leopard, Apple has deprecated the use of Applescript Studio, but fear not, in spite of a bit of extra typing, things are actually better without it. Go ahead and grab Xcode 3.2.5 or later. You can get 4.0 in the Mac App Store for free.
  2. images 2 of How to Make a Simple Program With Xcode
    Images 2 of How to Make a Simple Program With Xcode
    File>New Project
  3. images 3 of How to Make a Simple Program With Xcode
    Images 3 of How to Make a Simple Program With Xcode
    Click Applescript Application
  4. images 4 of How to Make a Simple Program With Xcode
    Images 4 of How to Make a Simple Program With Xcode
    Name your project, this example is named "Talking Example"
  5. images 5 of How to Make a Simple Program With Xcode
    Images 5 of How to Make a Simple Program With Xcode
    Your project should appear
  6. images 6 of How to Make a Simple Program With Xcode
    Images 6 of How to Make a Simple Program With Xcode
    Double click "Talking_ExampleAppDelegate.applescript"
  7. images 7 of How to Make a Simple Program With Xcode
    Images 7 of How to Make a Simple Program With Xcode
    There are already some items filled in for you. After the property declaration, insert a new handler:
    1. on clickedme_(sender)
    2. say "hello"
    3. end clickedme_
  8. images 8 of How to Make a Simple Program With Xcode
    Images 8 of How to Make a Simple Program With Xcode
    Type Cmd+B to build
  9. images 9 of How to Make a Simple Program With Xcode
    Images 9 of How to Make a Simple Program With Xcode
    Now double-click MainMenu.xib
  10. images 10 of How to Make a Simple Program With Xcode
    Images 10 of How to Make a Simple Program With Xcode
    Interface builder should open. Close any xib windows it brings up from previous projects you may have worked on.
  11. images 11 of How to Make a Simple Program With Xcode
    Images 11 of How to Make a Simple Program With Xcode
    A blank window should appear and you can drag a button onto it from the Library.
  12. images 12 of How to Make a Simple Program With Xcode
    Images 12 of How to Make a Simple Program With Xcode
    Double click the button and make it "Hello"
  13. images 13 of How to Make a Simple Program With Xcode
    Images 13 of How to Make a Simple Program With Xcode
    CTRL-drag from the Hello button to the blue cube called "Talking Example AppDelegate" and let go. You can now pick the clicked-me event handler to link to the "Hello" button you just made.
  14. images 14 of How to Make a Simple Program With Xcode
    Images 14 of How to Make a Simple Program With Xcode
    Now click file > save. You many now quit interface builder.
  15. images 15 of How to Make a Simple Program With Xcode
    Images 15 of How to Make a Simple Program With Xcode
    In Xcode, press build and go at the top. Your application should run smoothly.
4 | 2 Vote
« PREV : How to Rotate Images...
How to Control Your... : NEXT »