Skip to Content

John Franklin's blog

Objective-C Classes

If you are familiar with object-oriented programming, then you'll find Obejctive-C classes to be an easy concept to grasp. Each language has a different way of handling objects and object classes, any particular language may not support all features, but the base concepts are all similar.

Objective-C Basics

The first thing you need is to set up your build environment. For most of these examples, you can use any OS that supports GCC. If you're running on Mac OS X, install the development tools and you're done. For Ubuntu or Fedora, install the appropriate compiler packages and any dependencies. On Ubuntu, the build-essential package works well. For Fedora, install the Developer Tools grouplist and the gcc-objc package.

You'll also need the Foundation framework libraries and headers. Ubuntu keeps these in the libgnustep-base and libgnustep-base-dev packages. Fedora calls it gnustep-base-devel. Fedora also requires the gcc-objc package on top of the Developers Tools grouplist.

If you already know 'C', then you have a good basis for Objective-C. As the name implies, Objective-C is an extension of C, much like C++ is. Here is our first example source file example1.m:

On iPhone Development Demonstrations

I'm going to be presenting an iPhone programming demonstration at the November 2009 NoVaLUG meeting. Yes, I know that this is a Linux Users Group, and there's not much open source about the iPhone, but it does derive from some open source material: OpenStep, which lives on today as GNUStep. Now, gentle reader, I know what you're thinking. "If GNUStep is the current open source version of OpenStep, why don't you demo development with GNUStep?

Syndicate content