Mac OS X Tiger: For Developers
A Development Paradise
29 April 2005 Justin Williams Skip to comments
7 Comments
(
Closed)
### Introduction ### For those that live in code, the end user features like Dashboard and Spotlight might be cool, but what we really want ot know is what makes them tick and how can we incorporate them into our applications. It's no secret that Mac OS X is a developer's playground. With support for Cocoa, Java, Carbon, Applescript Studio, C, C++, Perl, and almost any other programming language, anyone can develop in their language of choice on the Mac. Even better, new developers can join in the sandbox since Apple bundles a free copy of the developer tools with every copy of Tiger. With Microsoft, developers usually have to buy an expensive copy of Visual Studio to develop in one of their many supported languages. Apple's barrier to entry is merely technical more than financial. This allows anyone with development experience to pick up a Mac and start coding away. If Apple hadn't done this, do you think we'd have all of the application choices we have today? I don't think so. ### Overview ### The goal of this article is to give an overview of the new technologies introduced for developers, outline some of the changes you will notice in your development environment, and maybe inject a little bit of my opinion when I deem necessary. This is by no means an exhaustive discussion on every aspect of Tiger from a developer's perspective. For that, you are going to want to rely on the ADC documentation. It contains not only tutorials and sample code, but also an exhaustive listing of methods for each framework. All developers should be required to add it to your Safari bookmarks bar beause it's such an essential reference. We will start with an overview of what's new in the land of Cocoa: Xcode 2, Interface Builder 2.5, and all the new frameworks. Next, we will move to an overview of what is new and different for Java developers on the Mac platform. Apple has been pushing OS X as the platform for Java developers, and it has been working. Finally, we will cover what's new for the Unix and web developer: Perl, PHP, Ruby, C, C++, and other Unix-centric languages. Let's get started. ### Xcode 2 ### Xcode was originally released with Panther as a replacement to the aging Project Builder. Project Builder was inherited from the NeXT days. Xcode brought a cleaner interface, predictive compilation, ZeroLink, Fix and continue, code sense, and a slew of other features. While Project Builder was sufficient for development, Xcode made it a pleasure. With Xcode 2, Apple has given it's development tool a major overhaul. The most noticeable difference is the inclusion of data and class modeling. Any developer who works on a project usually creates several diagrams that outline the relationships between their classes and their data. This is good practice because it forces the developer to think before coding. Planning saves time and money in the development cycle. Xcode's modeling support comes in two flavors: class models and data models. Class models allow you to view a visual hierarchy of your project's classes. Objective-C, C++, and Java are supported for class models. The class model is either a quick model or a user model. A quick model is a conventional class diagram. It shows all classes, has an automatic layout, and is not stored within the project. If you just want a quick overview of a project, these are a great tool. User models are more in depth and allow you to define the content and layout. They help the developer focus on a specific subset of the code as well as track changes that are going on. User models are defined via the _New File_ option in Xcode. User models can be imported into Subversion of CVS just like any other file in your project as well.With support for Cocoa, Java, Carbon, Applescript Studio, C, C++, Perl, and almost any other programming language, anyone can develop in their language of choice on the Mac. Learn about how Tiger makes developer's very happy geeks.
Data modeling has to deal with Core Data. Instead of modeling classes, you are modeling a relational database. We will discuss this more later in the article.
With the previous version of Xcode, users with low screen resolution suffered from a lack of screen space thanks to all the windows Xcode insisted on opening. A separate window was spawned for the project, code files, debugging, build results, and almost anything else. With Xcode 2, Apple has allowed for three different layouts: Default, Condsensed, and All-In-One. Default is the same layout that previous Xcode users are used to. If you enjoy window hell, Apple is not going to take it away from you.
Condensed puts all of your files and targets in separate tabs. It also groups other files in their own tab. Code windows are open in their own separate windows. This is somewhat of a mdidle of the road solution that works well for people that like to move their code windows around (I prefer putting my .h and .m files side by side).
The new all-in-one view is similar to Microsoft Visual Studio in that it condenses everything into a single document window. If you are on an iBook or an older machine with low resolution, this is the best solution because it takes full advantage of all of your screen real estate.
One problem with layouts is that you can't change the current layout with any open projects. Hopefully this can be resolved in future versions.
A welcomed feature of Xcode 2 is its Internet enabled documentation. Before, the documentation in Xcode wasn't nearly as up to date as what was available on the Apple Developer Connection website. Now the application periodically downloads updates directly to your Mac so that you can easily search locally using the most current information. This is a great thing for anyone that works remotely and doesn't have easy access to a wifi connection.
### Interface Builder ###
Interface Builder, a holdover from the NeXT days has received several enhancements for Tiger. Several new controls have been added for Mac OS X 10.4. One that made my day was the inclusion of NSDatePicker. This control allows developers to easily embed a calendar and clock into their application that lets users select a specific time for an event to occur. A working example of this control is in the Date/Time System Preference pane.
NSLevelIndicator is also new to Tiger. If you have ever checked the storage capacity of your iDisk in System Preferences, it is using NSLevelIndicator. NSLevelIndicator is also used in iTunes for the ranking system.
NSSegmentedControl is also included as a draggable item in Interface Builder. NSSegmentedControls allow you to group a set of similar controls. Segmented controls can contain images, text, buttons, or menus. Safari's toolbar is an
instance of NSSegmentedControl.
Interface Builder also includes several usability enhacements that will aide the developer. My favorite is the darkening of inactive windows. Anything not belonging to hte active document is darkened so that its apparent that it is not pertinent to the current document. This eliminates constantly clicking a window only to realize it is part of a different project.
Apple has also embedded the Human Interface Guidelines into Interface Builder. Anytime you select a control in a window or panel, you can click the purple Help button in the Inspector to launch the control's guidelines in the HIG. Whether or not Apple will adhere to their own HIG more now that they can easily access it when developing their interfaces remains to be seen!
### Core Data ###
Core Data will change the way you create applications the way Cocoa Bindings did in Panther. Cocoa Bindings removed the need for several layers of glue code in your application's controller. Core Data will do that for your model layer. Instead of having to write and manage code dealing with your data model, you can now create a data model that will take care of the heavy lifting for you. Creating data driven applications couldn't be easier.
Core Data stores your data in three formats: XML, binary, or SQL. SQL support is maintained through Tiger's implementation of SQLite. SQLite is a small, embeddable database that is incredibly fast for large applications. Several existing Mac applications take advantage of SQLite presently (though not thorugh Core Data). Freshly Squeezed Software's PulpFiction is an example of an SQLite driven application.
Core Data uses managed objects to define its entities. These objects are created in Xcode using the data modeling tools. In the tool, you can establish entities, relationships, and objects. Once your model is complete, you can even create a a prototype interface. By option-dragging your entities onto a window in Interface Builder, the application will construct a fully functional UI that you can use as a starting point for your application.
### Core Image ###
Core Image is an image processing technology built into Mac OS X v10.4 that takes advantage of your graphics card instead of your processor for applying filters and effects on images . The framework provides access to built-in image filters for both video and still images and provides support for custom filters and near real-time processing.
Core Image comes with support for several Image Units. Image Units are simply filters, transitions, and effects. With these units, you can blur, blend and adjust colors, distort, generate effects, create transitions, and many other activities for free. The beauty of the framework is also the ability to define your own Image Units. An Image Unit consists of an image processing kernel and some objective-c glue code to initalize the kernel code and provide an interface and output.
To get a better understanding of what Core Image does you will want to play with the Core Image Fun house under /Developers/Applications/Graphics Tools/. The Fun House application puts every built in Image Unit into a single application to let you see how each functions.
### Sync Services ###
Ever since Apple introduced its .Mac service, developers have been begging for access to the iDisk to allow their users to sync their data with .Mac. Apple has finally listened and created the Sync Services framework. Developers can embed the Sync Services framework into their application and offer users iSync-like functionality.
Sync Services makes this easy and unobtrusive to the user. Each of their client machines throws its data at the sync engine who then in turn merges changes between the different clients, selects synchronization modes for each respective client based on their needs, and also allows for resetting of a client's sync state.
While users have it easy in terms of using your application's syncing functionality, you as a developer will have some work to do. First, you will need to create a sync schema that defines the specific details about the entities in your data model. This schema also contains information about the relationships between your entities. Schemas can also be extened.
### PDFKit ###
Since its initial release, Mac OS X has been capable of reading and writing PDF files. This was always an Apple-only technology until now. Apple has opened the PDFKit framework to allow for developers to programatically read, create, and modify PDF files.
PDFKit containes two suites of Cocoa classes: a "view" class called PDFView and 18 utilities classes: PDFBorder, PDFDocument, PDFPage, PDFAnnotation, and several others. The PDFVIew class is similar to Web Kit's WebView in that it lets you easily call up a PDF file. It inherits from NSView.
The utility classes allow for the creation and modification of PDF files. The main file, PDFDocument represents a PDF File. PDFPages and PDFOutlines are contained within the PDFDocument.
### Other Geeky Developer Stuff ###
Mac OS X Tiger ships with version 1.4.2 of Java. Though it is not the latest version 1.5 (also named Tiger), it provides a solid foundation. I am sure Apple will release a 1.5 release in the future.
As for new features, Java code completion is in Xcode 2. Having to remember all of those silly method names is a thing of the past. Quartz hardware acceleration is now a part of Java in Tiger. This offloads the drawing operations your application performs from your processor to your video card (just like native OS X apps). Java applications are also accessible and scriptable in Tiger.
For command line junkies, Tiger ships with Perl 5.8.6, Ruby 1.8.2, PHP 4.3.10, GCC 4.0, X11, the Korn shell, and SQLite as mentioned before. Because OS X runs on FreeBSD, it can run anything Unix.
### Conclusion ###
As I stated before, this is just an overview of a few of the new technologies available to Mac OS X developers in Tiger. To get more information on the full implementations of the frameworks mentioned here or to learn about other neat things like Spotlight importers, Dashboard widget development, or developing 64-bit applications, you will want to visit the Apple Developer Connection.
Being a Mac developer was a fun and rewarding experience before Tiger, but now with all of these new technologies, our jobs got even easier.
Justin Williams is founder and chief author for MacZealots. He switched to the Mac almost five years ago hasn't looked back since. When not blogging or coding, you can find him watching copious amounts of TV. Justin can be reached at



Reader Comments (7)
DISCLAIMER: The views expressed below are those of their authors and not necessarily endorsed or supported by MacZealots.com. In all cases, the comments provided here are offered as a courtesy and will be moderated. Any content deemed off-topic or offensive will be removed without notice. Posting a comment here boils down to two things: 1.) Think before you type 2.) Respect the thoughts of others. See our commenting guidelines and/or privacy policy for more information.
#1) On May 3, 2005 11:15 PM
Nice summary about what’s going on with the tools.
#2) On June 18, 2005 3:34 PM
Nice article. Since Tiger is now available in retail we can begin working with the candies.
#3) On June 21, 2005 7:45 PM
Good overview, but you forgot that the C++ standard library is now dynamically linked, drastically reducing the size of C++ binaries. Poor C++, no one gives it the time of day anymore :)
#4) On July 10, 2005 9:50 PM
“With Microsoft, developers usually have to buy an expensive copy of Visual Studio to develop in one of their many supported languages”
I do notice the “usually” but felt the need to make the current odd-but-true reality a bit more up front for old time non-windows devs who are in a habit of downing MS development technologies.
The new way of things from Microsoft is that .Net’s main languages being C# and VB.Net do not require Visual Studio for anything. The .Net SDK is 100% free for download and both compilers come with it. No charge now, no charges planned.
MS Visual Studio is a great IDE for .Net but if you need an IDE for .Net development, which you may nhot and can in many cases get away with no more than a good editor) VS is Not the only game in town any more. Again, because the SDK is free and the core source of .Net is also available for download there can be and are real alternatives.
For example: SharpDevelop is free and has so many VS-level tools that it’s really kinda embarassing for other IDE makers (borland, IBM, and - sorry - Apple too IMHO).
It’s easy to keep the habit of downing windows development but if you really take a close look at the .Net/MONO big picture you might, as I have, catch yourself saying ‘wow, I can’;t believe that this is a Microsoft thing” Easy tools with great power … and weirdest of all: Free for the asking.
#5) On September 27, 2005 8:20 PM
I am useing MS VB .NET 2002 for school right now on VPC 7.2 I have two computers one is a PowerMac G5 Dule 2.5Ghz (3.5Gigs of Ram) & a 12 Inch PowerBook 1.5Ghz (512Mbs of Ram) VPC 7 is way to slow on the PowerBook I know I need more Ram but still I think it would not be great eaven on the G5 it is 20% of what no VPC app’s run. I would never use VB .Net but my Proff. will freak if I use anything but Wintels, So I told my mom I needed a computer to run Windoes I got a PowerMac G5.Wright asking to Appleto use the new Moto/Freescale & IBM PowerPC’s so Job’s will not make the same mistake twice! I know what I am talking about just look up www.Power.org or IBM then PowerPC or www.FreeScale.com the PowerPC can now do the Dule core/low power thing’s. Steave NO INTEL!!!!!!! MAC’S & yes Apple did file for the patent “Mactel” on the day the Intel’s where anounced. F Intel
#6) On November 11, 2005 2:33 AM
what we do in vb,net appllication code so it will run on mac operating system
#7) On March 27, 2006 4:11 PM
Java can talk to Carbon and Cocoa is what I keep hearing but it is not what I am seeing. I can find so few examples that it is making learning this trick, under the pressure of a project that requires it I might add, pretty doggone difficult. All I want to do is change a the doggone icon of an idividual file for Christmas’s sake.