Alastair’s Place

Software development, Cocoa, Objective-C, life. Stuff like that.

My Project

My project, which shall for the moment remain nameless and therefore shrouded in a certain degree of mystery, seems to be going OK. Cocoa is making it refreshingly easy to work on the GUI itself, and the back-end code pretty much writes itself. Pretty neat, really. It’s quite cool already, and although it doesn’t do much yet it is beginning to look like an application rather than just a toy.

Of course, I still have some way to go before shipping the first version (or even a Beta for that matter), but progress so far has been reasonable. Another thing that I’m quite pleased about is that I haven’t been slacking too much, which was always a worry starting to work for myself.

User Interface Design

It’s surprising how difficult it is to design a good user interface. I mean a really great user interface, not like the rubbish most programmers come up with when asked to design a UI. They just don’t think about how things are going to be used. (Apple can, of course, pat themselves firmly on the back for being good at this, but most other companies should take a look and see why their interfaces are so bad).

As for me, I’ve spent a great deal of time recently thinking about UI issues; my current dilemma is something of a horizontal vs. vertical problem… I have two user interface elements, one of which would look best horizontal, and the other of which would look best vertical (because it is a list of items, so a vertical layout will provide more space for the items’ information). Unfortunately for me, they both have to have the same orientation (because of the way they interact). At the moment I’m leaning towards vertical, but we’ll see.

Anacron

I’ve just packaged-up anacron and put it on my site so that people don’t have to figure-out how to install it themselves.


Update 2011-10-14

Anacron is no longer required on Mac OS X; launchd’s StartCalendarInterval functionality is equivalent and doesn’t require any third-party software.

Getting Icons for Disks in Cocoa

This has been frustrating me all day. I wanted to get the icons for a set of disks attached to my Mac, so I could display them in a dialog box. How hard could it be, I thought?

Finding the name of the icon file was OK; you just use the IORegistry functions, from which you can obtain a CFDictionary containing the name of the file and the bundle’s identifier. And there’s the sticking point. You can’t (normally) get from an identifier to a bundle, unless the bundle is already loaded in your application…

After a lot of hunting around, I started searching through the IOKit headers and finally found KextManagerCreateURLForBundleIdentifier(), which lets you obtain an NSURL (or CFURL) directly from a bundle identifier. Just to see whether I had blindly wandered straight past the right bit of Apple’s documentation, I queried Google for this function, and I got (wait for it) Mac OS X 10.2 release notes (useless), and one (yes, one) reference in Apple’s documentation, buried in the “Displaying Localized Information About Drivers” section of Apple’s IOKit documentation.

The only thing wrong with Cocoa is the documentation.

Blogging

I’m quite envious of Matt Webb’s skinnable weblog; actually I’m quite envious of Matt’s entire weblog, but then he’s been at it a good deal longer than I have (since February 2000, according to his archive links).

It’s strange that such an apparently simple idea has had such an impact on the World Wide Web, although it is probably somewhat closer to what Tim Berners-Lee had in mind when he came-up with the entire thing.

My First Day

I did, in the end, get down to it and do some real work (actually, I had already done some when I posted my first message, just not very much).

Cocoa development really is fascinating; it’s so different from the mess we developers have to put up with on other systems… not only have we got the UN*X APIs underneath, but we’ve got a really neat object system and a decent framework designed by someone that actually knows about OOD. And to think it was all around in the 1980’s!

In the Beginning

Until Friday, I worked for Telsis, a telecommunications equipment manufacturer based on the south coast of England. I’d been getting itchy feet for some time, especially as my friends kept leaving to travel round the world (Darren is a good example of this — see Hev and Darren’s Global Adventure).

The upshot of this is that three months ago, I resigned to work for myself, writing software for Mac OS X; today is my first day, and I thought that, rather than working (oops, 100% deviation from plan already), I’d set-up a weblog using the excellent Movable Type.

Anyway, I am Alastair and here is my blog.