TweetFollow Us on Twitter

Getting Started: Circa 2002

Volume Number: 18 (2002)
Issue Number: 11
Column Tag: Getting Started

Getting Started: Circa 2002

by Dave Mark

I have to tell you, it feels great to be back. It's been a little more than five years since my last Getting Started column, but it feels like an eternity. The long and winding road from the days of Inside Macintosh, Nubus cards, black and white monitors, GetPort() and SetPort(), trap patching, 68K emulation, etc. has turned a radical new corner.

Though the vast majority of all Macs still run System 9 or earlier, the future is clear. This is a unique moment in time and you have a unique opportunity. Back in the frontier days of Macintosh development, an unusual mix of elements was taking shape. There was a wonderful new computing platform that freed you from the traditional bonds of DOS. Instead of a limited (and frequently cryptic) set of commands that governed your interaction with your computer, applications such as MacWrite and MacPaint allowed you to express yourself in revolutionary new ways.

As with any revolutionary change, opportunities blossomed. People loved the Macintosh and, as word spread, their hunger for new applications grew dramatically. Problem was, developing a Mac application was completely different than the relatively simple process of building a DOS or Unix app. Back in the day, Inside Macintosh was a single volume that came in a loose leaf binder, and deciphering its mysteries required dedication and a great deal of trial and error. But, for those "in the know", there was money to be made. Startups were everywhere. This was fertile ground. Exciting times.

I loved those early days. The excitement of learning about something so new and so beautifully crafted inspired me. And once I understood the basics, I felt compelled to share my knowledge with the Mac development community. I wrote books like the Macintosh Programming Primer series, Learn C on the Macintosh and, of course, 7 years worth of Getting Started columns for MacTech.

Over time, each new release of the Mac OS brought less dramatic changes and the process moved from revolutionary to evolutionary. As the process of building a Mac application became less mystical and more practical, money came to the table and getting a Mac application to market and competing with established brands became harder and much more expensive. What was once a fun, "programming for the beauty of it" process moved from the computer science end of the spectrum to the marketing end of the spectrum. The pioneer days were dead.

And now we've come full circle. Mac OS X is a whole new beast. New APIs to learn, a new development environment to explore, new widgets to play around with. We've got a whole new frontier to explore and there are opportunities here for all of us.

Getting Started

There are a number of paths to explore here. We'll start with the most straightforward, building an app using the Objective C programming language and Apple's Cocoa framework. Over the coming months, we'll dig into the basics of Objective C. Over time, we'll take on Cocoa and, eventually, explore some of the other paths to build our Mac OS X apps. I'd also like to spend some time under the hood, exploring the OS upon which Mac OS X is based, Apple's port of the Unix operating system.

Go get the tools

There are a number of good choices out there when it comes to development tools. There's CodeWarrior from Metrowerks, REALbasic from REAL Software, a variety of AppleScript environments, and many others. For the moment, we're going to focus our attention on the tools that Apple provides, gratis, to ensure we all start on the same footing.

    When Apple bought NeXT back in December of '96, they got Steve Jobs back and they also got Steve's OS and the development tools crafted to work alongside the OS. The OS evolved into Mac OS X, and the tools became Apple's official Mac OS X dev tools.

Many of you already have Apple's dev tools in hand. Newer Macs ship with a Developer Tools CD. You may find that your Mac came with the tools pre-installed. Nonetheless, go through the web site, download the latest and greatest, and install them on your machine.

First step: Navigate to:

http://developer.apple.com

This is the home for the Apple Developer Connection, also known as ADC. There is a ton of great material on this site. You can sign up for Apple's various developer programs, including the Premier (US$3500 per year), Select (US$500 per year), Student (US$99 per year), Mailing (US$199 per year), and Online (FREE) programs. Take some time to go through the program descriptions to see if one of them is right for you.

To get the tools, all you have to do is register for the Online program. To register, send your browser to:

http://connect.apple.com

Click the "Join" button, read the license, click "Agree", then fill out the form and select your new Apple ID. Once your account is set up, log in, then select Download Software from the nav bar on the left hand side of the ADC window. Next, click Mac OS X from the sub-nav bar (Figure 1).


Figure 1. Click the Download Software link, then Mac OS X

There are a lot of choices on this page. As I write this, the latest releases are the July 2002 Mac OS X 10.2 Developer Tools and the August 2002 Dev Tools 10.2 Update. By the time this column gets to you, however, there may be a new release of the tools or another update. As a rule, download the most recent Developer Tools package first. Then, check to see if an Update package was released after the Developer Tools package. If so, download it as well. Install the Developer Tools package and the Update, if applicable.

Checking the Install

Once the tools are installed, you should have a directory named Developer at the top level of your hard drive. My Developer directory listing is shown in Figure 2. Take a few moments to go through the various Developer sub-directories.


Figure 2. The Developer directory after the tools install.

In the Applications directory, you'll find a number of interesting tools, including one we'll fire up in just a sec called Project Builder. For you CodeWarrior fans, Project Builder is sort of the equivalent of the CodeWarrior IDE, a command central for all your project files and the application that actually calls the compiler and other code building tools.

The Documentation folder is also filled with important goodies. Get to know what docs are available. There's a lot of good reading in there, and it's all free. One short file worth reading is the README.html file in the Documentation directory. This file will open in your web browser and lists various ways to access the documentation from within Project Builder.

If you'd like to get ahead of the game, take a look at the file:

/Developer/Documentation/Cocoa/ObjectiveC/ObjC.pdf

ObjC.pdf will give you a fairly thorough grounding in the Objective C language.

Take 'em For a Spin

Now that the tools are installed, let's take them for a spin. This month's project will be a simple C "Hello World" project, just to get a sense of the environment. Next month, we'll try our hand at some Objective C code.

Navigate into the /Developer/Applications folder and launch Project Builder. Select New Project... from the File menu. The New Project dialog appears, allowing you to specify the type of project you'd like to build. Scroll all the way to the bottom and select Standard Tool (Figure 3). Standard Tool builds an ANSI C command line program. Click the Next button.


Figure 3. Select the Standard Tool project template.

You'll be prompted for a directory in which to store all the project related files (Figure 4), including all source, object, and binaries. Name your project Hello World, then click the Choose... button to browse on your hard drive for a location for the Hello World folder. I created a Projects folder within my personal folder rather than storing the projects within the /Developer directory. I don't want to wipe out my projects when I decide to do a wipe and reinstall of the dev tools.


Figure 4. Saving your new project files.

Now click the Finish button. Project Builder will build a project for you, complete with a source code file named main.c containing a main() function any C programmer will recognize in a heartbeat.

The project window that appears contains a number of elements. We'll get into them in detail in next month's column. For now, the important elements are the "Groups & Files" pane, the code editing pane, and the toolbar (at the top of the window, the one with all the funny hammer icons).

In the "Groups & Files" pane, click on the disclosure triangle to the left of the Source folder icon. You'll reveal a single file named main.c within the Source group. Click on main.c. Notice the source code that appears in the code editing pane (Figure 5).


Figure 5. The Hello World source code listed in the project window's code editing pane.

Let's run this sucker. Click on the 3rd icon in the toolbar (the one with the hammer covered by a computer display). If you hover over the icon, a tooltip appears with the words "Build and run active executable". That's the one we want. This will compile our source, link our object code into an executable and run the executable. Do it.

Your result should be eerily similar to the one shown in Figure 6. Cool!


Figure 6. Hello World does its thing.

When you asked Project Builder to build and run your project, Project Builder did just that. If you click in the Window menu, you'll see three sub-items under the "Hello World - (Hello World)" item. The one selected in Figure 7 is the Build window. Under that is the Project window (in this case, listing the main.c source code). Under that is the Run window showing the output of the program execution.


Figure 7. Project Builder's Window menu.

You can close any of these windows at any time, though you'll likely want to keep the project window open so you can make changes to your source code and build and run your app.

Till Next Month...

Want to play some more? Good! Try making some changes to the source code. Got an old copy of Learn C on the Macintosh lying around? Try typing in some of that source code. And if you are really adventuresome, take the debugger for a spin. Hint: The tooltip for the 2nd icon from the left in the project window's toolbar says "Build and debug active executable".

Next month, we'll go through Project Builder in a bit more detail and go through the debugger as well. It's good to be back - Thanks for reading!


Dave Mark is very old. He's been hanging around with Apple since before there was electricity and has written a number of books on Macintosh development, including Learn C on the Macintosh, Learn C++ on the Macintosh, and The Macintosh Programming Primer series. Dave maintains a primitive web site at http://www.spiderworks.com

 
AAPL
$445.15
Apple Inc.
+3.01
MSFT
$34.27
Microsoft Corpora
+0.12
GOOG
$873.32
Google Inc.
-9.47

MacTech Search:
Community Search:

Software Updates via MacUpdate

Evernote 5.1.1 - Create searchable notes...
Evernote allows you to easily capture information in any environment using whatever device or platform you find most convenient, and makes this information accessible and searchable at anytime, from... Read more
SketchUp 13.0.3688 - Create 3D design co...
SketchUp is an easy-to-learn 3D modeling program that enables you to explore the world in 3D. With just a few simple tools, you can create 3D models of houses, sheds, decks, home additions,... Read more
Flavours 1.0.8 - Create and apply themes...
Flavours allows users to create, apply, and share beautifully designed themes. Classy - Give your Mac a gorgeous new look by applying delicious themes! Easy - Unleash your creativity and make your... Read more
GarageSale 6.6b10 - Create outstanding e...
GarageSale is a slick, full-featured client application for the eBay online auction system. Create and manage your auctions with ease With GarageSale, you can create, edit, track, and manage... Read more
Twitter 2.2.1 - Official Twitter client...
Twitter (was Tweetie) is a Twitter client with a variety of features. Important Note: As of January 2011, AteBit's Tweetie application has been acquired and renamed by Twitter. Version 1.2.8 of the... Read more
SteerMouse 4.1.6 - Powerful third-party...
SteerMouse is an advanced driver for USB and Bluetooth mice. It also supports Apple Mighty Mouse very well. SteerMouse can assign various functions to buttons that Apple's software does not allow,... Read more
Google Chrome 27.0.1453.93 - Modern and...
Google Chrome is a Web browser by Google, created to be a modern platform for Web pages and applications. It utilizes very fast loading of Web pages and has a V8 engine, which is a custom built... Read more
Labels & Addresses 1.6.5 - Powerful...
Labels & Addresses is a home and office tool for printing all sorts of labels, envelopes, inventory labels, and price tags. Merge-printing capability makes the program a great tool for holiday... Read more
Delicious Library 3.0.2 - Import, browse...
Delicious Library allows you to import, browse, and share all your books, movies, music, and video games with Delicious Library. Run your very own library from your home or office using our... Read more
KeyCue 6.5 - Displays all menu shortcut...
KeyCue helps you to use your OS X applications more effectively. Just hold down the Command key for a while - KeyCue comes to help and shows a table of all currently available keyboard shortcuts.... Read more

This Week at 148Apps: May 20-24, 2013
We Are Your App Review Source   | Read more »
Rhapsody Plays A New Visual Tune In The...
Rhapsody Plays A New Visual Tune In The Latest Update Posted by Andrew Stevens on May 24th, 2013 [ permalink ] iPad Only App - Designed for the iPad | Read more »
Bondsy Lets Friends Trade Their Stuff Pr...
Bondsy Lets Friends Trade Their Stuff Privately Posted by Andrew Stevens on May 24th, 2013 [ permalink ] iPhone App - Designed for the iPhone, compatible with the iPad | Read more »
Wander Wheel Hands You An Itinerary, Tel...
Wander Wheel Hands You An Itinerary, Tells You To Be Spontaneous Posted by Andrew Stevens on May 24th, 2013 [ permalink ] | Read more »
Flick Transfers Files To Other Devices W...
Flick Transfers Files To Other Devices With A Simple Flick Of Your Finger Posted by Andrew Stevens on May 24th, 2013 [ permalink ] | Read more »
Guitar! by Smule Strums Onto The App Sto...
Guitar! by Smule Strums Onto The App Store Posted by Andrew Stevens on May 24th, 2013 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Redline Rush – Avoid The Toll Booth On T...
Redline Rush – Avoid The Toll Booth On This Now Free Endless Racer Posted by Andrew Stevens on May 24th, 2013 [ permalink ] | Read more »
Kite Surfer Review
Kite Surfer Review By Rob Rich on May 24th, 2013 Our Rating: :: MAKE SOME WAVESUniversal App - Designed for iPhone and iPad Kite Surfer looks good and controls great, although it’s also a little light on content.   | Read more »
Spottlife Review
Spottlife Review By Lee Hamlet on May 24th, 2013 Our Rating: :: CATEGORIZE YOUR SOCIAL LIFEiPhone App - Designed for the iPhone, compatible with the iPad Spottlife is a new way to view and interact with the world’s most popular... | Read more »
Plasma Pig Review
Plasma Pig Review By Jordan Minor on May 24th, 2013 Our Rating: :: THAT'LL DO, PIGUniversal App - Designed for iPhone and iPad This porky pig needs a light touch.   | Read more »

Price Scanner via MacPrices.net

Memorial Day Weekend MacBook Pro sales, up to $200...
 Save up to $200 on a 15-inch MacBook Pro this Holiday weekend at these resellers: (1) B&H Photo has 15″ MacBook Pros on sale for up to $200 off MSRP including free shipping. B&H will also... Read more
Apple drops prices on refurbished iPads and iPad m...
 Apple today dropped prices on Apple Certified Refurbished iPad 4s and iPad minis with some models now available for up to $140 off the cost of new models. Apple’s one-year warranty is included with... Read more
Should You Upgrade To OS X 10.8 Mountain Lion This...
If you haven’t upgraded to OS X 10.8 Mountain Lion by now, there’s probably a case to be made for just holding out with whatever earlier version you’re using until we see what Apple brings forth with... Read more
Apple Tops Gartner Supply Chain Top 25 Rankings Fo...
Gartner, Inc. has released the findings from its ninth annual Supply Chain Top 25. The goal of the Supply Chain Top 25 research initiative is to raise awareness of the supply chain discipline and how... Read more
7-inch Tablets: What User Experience Benchmarks Sh...
A new Tablet User Experience Research survey by Pfeiffer Consulting indicates that user experience with tablets and smartphones is one of the most important aspects of the overall perceived value of... Read more
PayPal Global Study Spells Doom for the Wallet – C...
PayPal has revealed the findings of a global study that paints a dim future for the wallet. A vast majority (83%) of respondents across five countries indicated they wished they didnt have to carry a... Read more
How to Set Up Your Mac to Allow AirPrinting From i...
mac.tutsplus.com’s Jordan Merrick says: AirPrint is a great feature of iOS that provides a simple way of printing documents from your iPhone or iPad directly to an AirPrint-compatible printer with no... Read more
Price drop on refurbished 15″ 2.3GHz MacBook Pro,...
 The Apple Store has lowered their price on Apple Certified Refurbished 15″ 2.3GHz MacBook Pros to $1449 or $350 off the cost of new models, including free shipping. Apple’s one-year warranty is... Read more
Memorial Day Weekend iMac sale: $150 off MSRP
 Best Buy has iMacs on sale for $150 off MSRP on their online store for Memorial Day Weekend. Choose free home shipping or free instant local store pickup (if available): - 27″ 3.2GHz iMac: $1849.99... Read more
Economic Conservatives Defend Apple’s Tax Strategy
Given Apple’s longtime reputation as the particular darling of the liberal lefty end of the spectrum, it’s been facinating to see mostly prominant conservatives rallying to the defense of Apple’s... Read more

Jobs Board

System Engineer - *Apple* /Mobility - P...
System Engineer - Apple /Mobility Tracking Code 305801-533 Job Description Job Summary: As a Apple /Mobility Systems Engineer you will be involved in all aspects of Read more
*Apple* Account Executive - CompuCom (U...
Apple Account Executive Job Location US-IL-Des Plaines Posted Date 3/27/2013 Req # 2013-4905 Apply/Socialize: * Apply Now! * Email this opportunity to a friend or Read more
*Apple* Account Executive - CompuCom (U...
Apple Account Executive Job Location US-MAUS-DC Posted Date 3/27/2013 Req # 2013-4907 Apply/Socialize: * Apply Now! * Email this opportunity to a friend or Read more
*Apple* - Solution Architect - CompuCom...
Apple - Solution Architect Job Location US-TX-Dallas Posted Date 4/18/2013 Req # 2013-4932 Apply/Socialize: * Apply Now! * Email this opportunity to a friend or Read more
*Apple* - Solution Architect - CompuCom...
Job Location: US-TX-Dallas Posted Date: 4/18/2013 Overview: The Apple Solution Architect (SA) will be responsible for supporting pre-sales and post-sales solutions in Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.