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
$102.25
Apple Inc.
+0.12
MSFT
$44.88
Microsoft Corpora
+0.01
GOOG
$569.20
Google Inc.
-1.80

MacTech Search:
Community Search:

Software Updates via MacUpdate

Cloud 3.0.0 - File sharing from your men...
Cloud is simple file sharing for the Mac. Drag a file from your Mac to the CloudApp icon in the menubar and we take care of the rest. A link to the file will automatically be copied to your clipboard... Read more
LibreOffice 4.3.1.2 - Free Open Source o...
LibreOffice is an office suite (word processor, spreadsheet, presentations, drawing tool) compatible with other major office suites. The Document Foundation is coordinating development and... Read more
SlingPlayer Plugin 3.3.20.505 - Browser...
SlingPlayer is the screen interface software that works hand-in-hand with the hardware inside the Slingbox to make your TV viewing experience just like that at home. It features an array of... Read more
Get Lyrical 3.8 - Auto-magically adds ly...
Get Lyrical auto-magically add lyrics to songs in iTunes. You can choose either a selection of tracks, or the current track. Or turn on "Active Tagging" to get lyrics for songs as you play them.... Read more
Viber 4.2.2 - Send messages and make cal...
Viber lets you send free messages and make free calls to other Viber users, on any device and network, in any country! Viber syncs your contacts, messages and call history with your mobile device,... Read more
Cocktail 7.6 - General maintenance and o...
Cocktail is a general purpose utility for OS X that lets you clean, repair and optimize your Mac. It is a powerful digital toolset that helps hundreds of thousands of Mac users around the world get... Read more
LaunchBar 6.1 - Powerful file/URL/email...
LaunchBar is an award-winning productivity utility that offers an amazingly intuitive and efficient way to search and access any kind of information stored on your computer or on the Web. It provides... Read more
Maya 2015 - Professional 3D modeling and...
Maya is an award-winning software and powerful, integrated 3D modeling, animation, visual effects, and rendering solution. Because Maya is based on an open architecture, all your work can be scripted... Read more
BBEdit 10.5.12 - Powerful text and HTML...
BBEdit is the leading professional HTML and text editor for the Mac. Specifically crafted in response to the needs of Web authors and software developers, this award-winning product provides a... Read more
Microsoft Office 2011 14.4.4 - Popular p...
Microsoft Office 2011 helps you create professional documents and presentations. And since Office for Mac 2011 is compatible with Office for Windows, you can work on documents with virtually anyone... Read more

Latest Forum Discussions

See All

Hyperlapse Review
Hyperlapse Review By Jennifer Allen on August 28th, 2014 Our Rating: :: SPEEDY VIDEO SNAPSUniversal App - Designed for iPhone and iPad Want to make a great time-lapse video quickly? Hyperlapse is perfect for that.   | Read more »
Back To Bed Review
Back To Bed Review By Jennifer Allen on August 28th, 2014 Our Rating: :: STYLISH BUT LIMITEDUniversal App - Designed for iPhone and iPad It looks gorgeous, but Back to Bed is actually a fairly simple and uneventful puzzle game.   | Read more »
New Cars, New Locations, and a New Seaso...
New Cars, New Locations, and a New Season in Asphalt 8: Airborne Update Posted by Jessica Fisher on August 28th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Award Winning Children’s Book Bedtime fo...
Bedtime for Sarah Sullivan is a children’s storybook that emphasizes the importance of going to bed, dreams, and those magical moments right before being tucked in. Now Kelly Paniagua, author of the award-winning children’s book, is planning to... | Read more »
Happy Cube Death Arena Review
Happy Cube Death Arena Review By Jordan Minor on August 28th, 2014 Our Rating: :: CUBEDUniversal App - Designed for iPhone and iPad Happy Cube Death Arena is adorably violent, but very, very shallow.   | Read more »
8bit Doves, the New Game from Icebreaker...
8bit Doves, the New Game from Icebreaker Developers Nitrome, is Now Available – and in Four Colours Posted by Ellis Spice on August 28th, 2014 [ | Read more »
Ace Ferrara and the Dino Menace Review
Ace Ferrara and the Dino Menace Review By Nadia Oxford on August 28th, 2014 Our Rating: :: DINO-MYTEUniversal App - Designed for iPhone and iPad Ace Ferrara and the Dino Menace combines space combat and weird humor into a fun game... | Read more »
Draw Stuff, Win Prizes. Glorkian Warrior...
Draw Stuff, Win Prizes. | Read more »
Lots of iOS Games Have Been Deeply Disco...
Labor Day is fast approaching, and so are the sales. Lots of sales, by the look of it. This list is already pretty sizable, and we haven’t even made it to the weekend yet. Naturally that means you can expect there to be plenty more price drops and... | Read more »
Letter Pix Review
Letter Pix Review By Jennifer Allen on August 28th, 2014 Our Rating: :: FLAWED WORDPLAYUniversal App - Designed for iPhone and iPad Create words to clear the board and guess a photo underlay correctly in this fun but flawed word... | Read more »

Price Scanner via MacPrices.net

Save up to $60 with Apple refurbished iPod to...
The Apple Store has Apple Certified Refurbished 5th generation iPod touches available starting at $149. Apple’s one-year warranty is included with each model, and shipping is free. Many, but not all... Read more
12-Inch MacBook Air Coming in 4Q14 or 2015 –...
Digitimes’ Aaron Lee and Joseph Tsai report that according to Taiwan-based upstream supply chain insiders, Apple plans to launch a thinner MacBook model either at year end 2014 or in 2015, and that... Read more
Sapphire Screen “Most Wanted” iPhone 6 New Fe...
According to the ‘uSell.com iPhone Most Wanted Survey’ — a representative survey of 1,000 U.S. smartphone users conducted by used iPhone marketplace uSell.com — close to half of all smartphone users... Read more
The iPad’s Real Competitive Challenger (Not S...
It’s been my contention for some time that the iPad is suffering from something of an identity crisis, and I suspect that may be a factor in slackening sales this year. Apple can’t seem to decide... Read more
13-inch 2.6GHz/256GB Retina MacBook Pro on sa...
B&H Photo has the 13″ 2.6GHz/256GB Retina MacBook Pro on sale for $1379 including free shipping plus NY sales tax only. Their price is $120 off MSRP. Read more
Life Inventory iOS Apps – Learn to Know Thyse...
James Hollender’s Life Inventory apps s are now on sale with 20% off thru Labor Day, 09/01/2014. This is a great opportunity to get started on that Moral Inventory you’ve been putting off doing for... Read more
Pocket Watch, LLC. Reveals Cloud Server For P...
Beaumont, Texas based Pocket Watch, LLC. has announced the availability of its new ActivePrint Cloud Server Powered by Raspberry Pi. With this small standalone box almost any USB printer or available... Read more
902it Simplifies Area Code Changes For Nova S...
The east coast Canadian provinces of Nova Scotia and Prince Edward Island are phasing in 10 digit telephone dialing, to be fully in place by November, in order to accommodate a second area code to... Read more
Boomerang iPad Stand Mounts Your iPad Anywher...
Boomerang, a Mountable Stand with Multiple Viewing Angles, is now available for iPad Air. Boomerang combines several functions that aim to expand your iPad’s potential in one, elegant product. The... Read more
Retina MacBook Pros available starting at $10...
The Apple Store has Apple Certified Refurbished 13″ and 15″ MacBook Pros available starting at $929. Apple’s one-year warranty is standard, and shipping is free: - 13″ 2.5GHz MacBook Pros (4GB RAM/... Read more

Jobs Board

*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
Senior Event Manager, *Apple* Retail Market...
…This senior level position is responsible for leading and imagining the Apple Retail Team's global event strategy. Delivering an overarching brand story; in-store, Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
Project Manager / Business Analyst, WW *Appl...
…a senior project manager / business analyst to work within our Worldwide Apple Fulfillment Operations and the Business Process Re-engineering team. This role will work Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.