Archive for August, 2008
Properties, Setters and Dot Syntax
I’ve been ramping up on iPhone development, and with the NDA still in place (as far as I know), I haven’t been able to blog about what I’ve written/learned. And with that, it’s been quiet in here. Too get back into this, let’s continue to spend some more time on Objective-C… The properties feature in [...]
Private Methods
One common complaint for many new to Objective-C is that the language lacks support for private methods within a class. There are compiler directives for instance variables: @private, @protected (the default) and @public. However, if you want to hide methods, there is no specific directives to help. The example here builds on the previous post [...]
Categories
As an alternative to subclassing, Objective-C categories provide a means to add methods to a class. What’s intriguing, is that any methods that you add through a category become part of the class definition, so to speak. In other words, if you add a method to the NSString class, any instance, or subclass, of NSString [...]
Initializers
The code for creating new instances of a class generally looks as follows: 1 SomeClass *ptr = [[SomeClass alloc] init]; In this case, we send a message (alloc) to the recevier (SomeClass) to create a new instance; the object returned from this message, then sends a message (init) to initialize instance variables within the class. [...]
TextMate and Xcode
I’ve been spending time getting familiar with Xcode as I learn to write applications in Objective-C, with the larger goal of writing applications for iPhone. My editor of choice on the Mac up to this point, is TextMate, an great all around code editor. I’ve written a number of tutorials/tips on TextMate on my Mac [...]
Memory Management
First off, it’s worthing clarifying that much of what is covered here is as much Cocoa as it is Objective-C. However, since the two are quite closely tied when it comes to developing Mac/iPhone applications, I’ve decided to keep with the Objective-C theme as it relates to the title of this and subsequent posts. This [...]
Messaging
This post introduces messaging within Objective-C. Messaging is the terminology for invoking methods on an object. The format for a message expression is as follows (the brackets are required): [object method] or in Objective-C parlance [receiver message] Here’s a simple example: 1 2 3 4 5 6 // Create an instance of SomeClass object // [...]
Defining a Class
One of the first topics to cover when learning to develop native iPhone applications is how to code in Objective-C. Apple offers the Objective C Reference , a good resource, however, the best way to learn is by writing code. I took to Xcode to write a few simple examples, you’ll find the code below. [...]
Iphone SDK: First Impressions
I’ve been spending some time with the iPhone SDK to get a perspective on the architecture, tools and overall landscape. In addition, I’ve started to develop a few applications with Xcode (Cocoa/Objective-C) to exercise the tools for building iPhone applications. More on application development next week… So far, I’m impressed. Here’s how I see things… [...]


