Getting Started with Cocoa and Objective-C

Most of my posts related to programming on this site center around programming .NET using C# on Windows. Well, it looks like that era in my programming career has come to a close. I bought a MacBook Pro back in June and have been working toward starting to learn how to develop applications for the Mac. I’ve waited until now for several reasons–one of which is that the new XCode 3.0 and Objective-C 2.0 just came out with Mac OS X Leopard. As I have time, I am going to start documenting my experiences here to help others figure things out as well. I could be wrong, but with the introduction of Mac OS X Leopard, I believe the demand for Mac developers is going to rise dramatically. Time will tell.

Anyhow, while my general programming experience is very useful to me as far as logic and flow are concerned for developing an application, the Apple way of doing things is different and takes some getting used to. From what I’ve seen so far, though, is that the Apple way is also very cool. I am fortunate to work with Marcus Zarra who is an independent software developer on the Macintosh. He is helping me close some gaps in my own knowledge and so I’m going to journal the things I’m learning here from now on.

So, lets get coding…

Extract DVD Audio in Mac OS X

Handbrake is a great application for extracting your DVDs for use on your laptop or your iPod, but I’ve also recently found it to be the path of least resistance for extracting audio tracks from movies as well.

Every now and again it’s fun to grab an audio clip to use in my own media projects, but this often seems cumbersome. Recently I’ve started grabbing video clips with Handbrake for video projects, but I realized that sometimes all I want is the audio. Here’s how I did it.

Determine the scene number of the scene from which you want to extract the audio (go to scene selections in the DVD menu in your DVD Player app and find it that way). Once you know the scene number, close DVD Player and open Handbrake. Select the scene range in the Chapters section–setting the same number for both selections as this will extract just the one scene (chapter). Choose the other settings you want it to have and then click Start.


Once it has finished extracting, you can then open iMovie HD and drag and drop the new clip from the Desktop or wherever you saved it in Handbrake into the clips section of iMovie HD (I’m still using 06′). This will begin importing the clip. Once it has been imported, you can select the clip in the clips section and then choose File | Export…. In the resulting dialog box, select “Expert Settings” in the “Compress movie for:” drop down. Then click Share.

iMovie HD Export Dialog

Another dialog box will display. In the “Export:” drop down box, select “Sound to Wave”. Choose a location to save the file to and click Save.

iMovie HD Export Dialog Expert Settings

That’s it. It’s really simple if you have the right tools and in this case, all of the tools are free (well, at least included if you consider you paid to get your Mac which came with iMovie).

Have fun.

Mac OS X86 Project

For a long time I have loved the Macintosh and the Mac OS platform. It has just been difficult for me to ever justify owning a Mac because the work I do is all Microsoft Windows based.

Recently there has been a flurry of posts over at Digg and other technology news sites that discuss how to install the Mac OS on Intel hardware. This, of course, has been made possible first and foremost by Apple, when they released development computers to premium members of the Apple Developer Network, and then ultimately by hacker types in the community at large who were able to circumvent the security technology that was intended to keep users from installing the OS on any arbitrary Intel based hardware and then making available a disc image of the installation.

After reading several posts, I decided to try and see if I was able to get the Mac OS running on my own Dell laptop. The main site with information about the MacOS X86 port is of course , however, there are others. I found the necessary files and created the install disc. I then purchased a secondary hard drive and bay for my laptop and ran the install last night. It worked very well. Out of the box I had networking support and audio support.

Software such as most of the iLife suite has to run using a technology named Rosetta which provides an emulation layer. This makes it quite inefficient to use most of those applications since they are already resource hogs without the emulation, so I am finding that I can’t really see using it as a permanent setup. I will purchase one of the MacIntel computers when they are available, but this has been a great way to get to know the Mac OS.

I also plan to start learning how to write code for the Mac when I get some free time. This is a great way to do it without having to make the initial investment yet. The time will come for that and when it does, I’ll be ready to start building applications for the excellent Mac OS X platform.