cocoabig

Cocoa Articles

The blog entry articles about Apple's Cocoa programming environment are posted here. These series of articles aim to remove confusion and provide an environment where it easy to learn the complexity of Cocoa. They use very simple code examples, and explain each one as the code is modified to add new functionality and demonstrate new techniques.

Current Project: Aperture 1.5 Export Plugin

PlugInIconMy current project is to write an export plugin for Aperture 1.5. Initially it will give exported images random file names, but once that is working I will enhance it to do more random things. It is called Random Wok. Version 1.0 is now available on the Download Page.

The four most recent articles in this series are:

36. Integrating Localized Data Part 2
35. Integrating Localized Data Part 1
34. Instructions To Localizers
33. Preparing For Localization

XCode and Subversion

subversion_logoI have been setting up a subversion repository for my own use with XCode. These pages show how I did it. Part 4 is now up.

Key Value Coding

page46_blog_entry22_1
If you are new to programming in Cocoa on the Apple Mac, then you are probably confused by Key Value Coding, Key Value Observing, and bindings. KVC is all about being able to manipulate instance variable without using accessors. It's very handy to be able to do this because the less code you write, the less there is to debug. It also introduces a whole host of powerful built-in features that, again, you don't have to code for.

The ten articles in this first series each reference an XCode project and are targeted at XCode 2.3 and Mac OS 10.4 (Tiger). The projects are available on the download page in a single ZIP file and are named KVO1 on up. Yes, the KVC articles use projects called KVO because eventually it will progress to KVO.

Resources For Cocoa Programmers

libraryI have a page of resources for Cocoa Programmers. These are the places I go to for help and advice.

Clicker

clickerfinalClicker was my first Cocoa project. It was written to help me understand Cocoa bindings and is very simple. It's a good way to see KVO compliant methods at work. It is targeted at XCode 2.0 and OS X Tiger. The specification for clicker is:

A slider and a text field are bound together so that each reflects the other's value. A button labeled Click doubles the value in the text field.

Enabler

enablerwindowcentered

Enabler was written to gain more experience with interface elements, experiment with enabling and disabling interface elements, and to increase my understanding of outlets and actions. No bindings here. It includes use of the speech synthesizer and follows the Model-View Controller paradigm. Along the way I had to create a subclass of a view element. It is targeted at XCode 2.0 and OS X Tiger. The specification for this project is:

Speak one of four words when a button is pressed. Select the word to be spoken with a pop-up menu. While the word is being spoken, display a progress bar. Repeat the word between 1 and 5 times, selecting the number of repetitions with a slider and showing the result in a text field. The slider, button, progress bar, and pop-up menu are each enable by a separate checkbox.

BTNumbers

btnumbersBTNumbers (originally called Crunchie) is a document-based program that uses a worker thread. It searches for Bagelturf numbers [Update: these are called Armstrong Numbers] (read the blog for a definition). It includes many new things: managing a more complicated interface, saving and loading files using NSCoder, lots of bindings, locks, NSTableView, value transformers, delegates, thread communication, custom icons, menu modification, and more. It is targeted at XCode 2.1 and OS X Tiger. Here is the spec:

Create documents, each one of which is capable of allowing the user to enter parameters to calculate Bagelturf numbers. Provide controls for initating, pausing, and stopping calculation, and a table for displaying the results of the calculations. Allow the user to save and open documents in any state except active calculation. Show a progress bar that reflects the progress of the calculation.

BTRelate

BTRelate is a framework and a set of unit tests. The idea was to create a framework that allowed objects to maintain relationships such that any related object was aware of the relationships it was a member of. This is unlike collections (NSArray etc.) where the objects in the collections are not aware of their membership. It includes unit tests and a test program that links with the framework. It is targeted at XCode 2.1 and OS X Tiger.

Here is the spec:

Create a framework that provides facilities for arbitrarily relating object instances using a scheme based on group membership. Make it efficient for large groups. Make it bindable. Implement delegates for some features and provide notifications. Provide unit tests.

This spec is pretty open-ended -- that way I can stop when I think I am done and revisit the code to enhance it.

I ran out of time on this. Life simply got too busy to continue.
The Bagelturf site welcomes Donations of any size