TrapIt

My friend Aaron has been working on an iPhone game for ages, and now it has finally been released. It is well worth the NZ$1.29 being charged (there is no demo version available).

TrapIt Title Page

You can see more about the game at the TrapIt official site, or jump straight to the App Store page.

I must say I am a little envious. I have been an Apple Registered iPhone developer for 3 years and haven’t managed to produce anything.

UIButton.titleLabel is not as useful as it looks

I have been doing some iPhone development lately. Nothing too amazing, just some test apps to get a feel for the system. Now, some people will tell you that Cocoa Touch is an API sent from God and frankly it is pretty good (especially given what passes for UI on other embedded devices), but that doesn’t mean it doesn’t have some annoyances.

Here is something that tripped me up for a while. The UIButton class has a property called titleLabel which (obviously) returns the UILabel that is used to display the text of the button. You can use this property to modify the parameters of the label, like so:

1
2
3
m_addButton.titleLabel.font = [UIFont systemFontOfSize: 7];
m_addButton.titleLabel.textColor = [UIColor blackColor];		 
m_addButton.titleLabel.textAlignment = UITextAlignmentRight;

What you can’t do is this:

1
m_addButton.titleLabel.text = @"Add Stuff";

Although nothing I have found in the documentation says so, the text of the button cannot be set from the titleLabel property. What you have to do is this:

1
[m_addButton setTitle:@"Add Stuff" forState: UIControlStateNormal];

Setting the title this way works, and has the advantage that you can specify different text for different states:

1
2
[m_addButton setTitle:@"Add Stuff" forState: UIControlStateNormal];
[m_addButton setTitle:@"Add Stuff (not now)" forState: UIControlStateDisabled];

This is perhaps not that interesting for text titles, but is an excellent way to control the image the button shows based on whether the button is enabled, highlighted, and/or selected.

How to change the dictionary in MacOSX

I love MacOSX, and one of the best features is the almost ubiquitous built-in dictionary. So it is surprising that I after 3 years I have only just now discovered how to switch the dictionary from the default American English to British spellings. For some reason this is not part of the normal System Preferences pane, nor does setting your region or system language have any effect on spelling. I knew there had to be a way, but could never find the trick until today.

In case anyone else is having the same problem, here is what you have to do:

  1. Open an application that supports the in-built dictionary (pretty much anything except for Firefox). If in doubt use TextEdit.
  2. Right click on a text input area and select Spelling and Grammar -> Show Spelling and Grammar from the menu. Alternatively, the same menu option is available from the Edit menu.
  3. Select the dictionary you want from panel that pops up. Although the panel looks like part of the application you are using changes to the settings here apply across the entire OS.
  4. Enjoy the sensation of spelling words with lots of silent letters just like Queen Elizabeth II and God.

spelling

Space Ace

Remember Space Ace? The massive machine at the back of the greasy arcade you used to frequent? The one that played a cartoon that you had to react to? The one that cost twice as much as any other game? Of course you do. Well now it is back, and it’s just as bad as it was back then.

Space Ace

Space Ace (like its older brother, Dragon’s Lair) was/is on the very edge of the graphics/gameplay scale. The graphics were amazing, consisting of several minutes of action packed hand-drawn animation. But all it was really doing was playing video clips straight from a laser disk which meant that interaction was limited. Every few seconds something on the screen would flash, which was your cue to move the joystick in that direction. React too late and the hero would die in some amusing way. There was nothing quite like it.

Space Ace has just appeared in the iTunes store, and I felt oddly compelled to shell out the $6.50 asking price and suffer through the 280Mb(!) download. The animation is just as I remember it, unfortunately so is the gameplay. It is basically Guitar Hero, but “controlling” the beats of action on screen rather than beats in a musical score. This is not in itself a terrible idea, but there is only so much video you can fit on a laser disk circa 1982 so the plot is very short and once you have learnt the patterns the game is very easy. The onscreen joystick works OK, but is quite picky so you have to be exact with your fingers.

Space Ace

Despite these limitations, Space Ace is in its heart an imaginative and silly game. I find myself enjoying revisiting it even though I will probably finish it in the next few days.

View Space Ace attract sequence on Youtube.

Safari 4 is Pretty Good

Safari 4 has been out for a couple of days now, and I must say I am enjoying using it. On the Mac, Safari has always had a great overall browser experience but Firefox always managed to stay my weapon of choice for viewing the Internet. This may change, Safari 4 is a very nice piece of software.

Apple is clearly wanting to make Safari an integral part of the Mac experience – Safari is very well integrated into the Mac OS (you can use Spotlight to search your history, passwords are stored in the keychain, etc), and the UI has all the polish you would expect from Apple. I particularly like the graphical Top Sites view that Safari presents when you first start it.

One thing I have always liked about Safari is the way it renders text and graphics. It always seemed to be just that little bit more polished than other browsers – correctly anti-aliasing fonts and respecting the embedded colour profiles of images. In my opinion Safari is still the best looking browser.

Apple are making a big song-and-dance about how Safari 4 is much faster than other browsers. What they mean is that they have included a very good Javascript JIT compiler which speeds up script-heavy sites by a large margin. This is excellent news, but Safari is hardly alone in focusing on Javascript performance and very recent versions of other browsers have very similar performance.

On Windows, Safari is something of an oddity. It works just as well and still renders sites better than most other Windows browsers, but its awkward neither-Mac-fish-or-Windows-fowl UI doesn’t help. The Windows version also lacks the smooth GUI animation that makes the Mac version so pleasant to use. Apple are doing their best to push Safari onto iTunes users, but I can’t see it taking off except among web developers, Safari’s built in web development tools are very cool.

There are still a few problem areas. Safari doesn’t seem to enjoy displaying animated GIFs, which often stutter before they are fully loaded. It very occasionally beachballs for a second on some pages, not all the time but enough to be annoying.

Finally, another rant about the HTML video tag (since the last one got quite a bit of attention): Safari supports the video tag but farms out the video to Quicktime. I suppose this is better than nothing, but you can tell that it is not well integrated. Videos do not show up in the list of page assets and it is clear that Quicktime is downloading the video itself, bypassing the browser’s cache. On top of this, performance is quite poor when the Javascript controls are used. The video quality is top-notch, but the experience is disappointing.

It sounds like I am dumping on Safari, but really they are minor niggles in a sea of greatness. I still think Firefox has the edge (particular Firefox3.5, which is shaping up nicely) but you could do worse.

iTunes DJ

Apple has a new iPod out and that means a new version of iTunes. Along with support for the new device, there are a couple of interesting new features.

The first is autofill, a feature that I have been waiting for since I a got my first iPod. Up until now there has been no way to tell iTunes to simply fill up an iPod with music; you had to much around creating smart playlists and manually juggle how much space each one took up. Now you can just let iTunes fill the iPod from a playlist. It still isn’t as flexible as I would like (if I want to fill my iPod with 30% Scandinavian Death Metal, 40% Classical and the rest with 80s cartoon theme songs I see no reason why iTunes can’t accommodate me), but we now have the option.

iTune DJ Options Dialog

The second feature, iTunes DJ is an overhaul of the old Party Mix feature and is potentially awesome. Like Party Mix, it is basically shuffle on steroids, you select a playlist for your party and iTunes plays the songs. The interesting part is that it integrates in with the Remote iPhone/iPod Touch app. The allows you to mess about with the playlist from your portable device while your laptop is sitting on top of the stereo pumping out your cool tunes.

Even better, your guests can suggest upcoming songs and vote on what they want to hear next from their mobile devices. Luckily your guests can’t change the currently playing song, but everyone gets to have their say.

This will make iPhone/iPod Touch owners even more insufferable at parties, but frankly none of us care what you think. Count yourself lucky that we let you hang out with us in the first place.

Replacing a MacBook Hard Drive

My first-generation MacBook laptop had only one problem – its first generation 60 gig hard disk. Actually it used to have two problems, but I installed more memory in it ages ago. 60 gigs doesn’t go far in today’s world of movies and huge software packages, so I felt it was time to upgrade. One trip to the store and a $167 EFTPOS transaction later and I am the owner of a new 320 gig hard disk, which seems to be the current sweet spot for price vs. capacity for 2.5 inch drives.

Thankfully Apple have made the job of replacing a MacBook’s hard disk extremely easy, and they provide step by step instructions. All you need is a 10c coin, a Philips #1 screw driver, a piece of stiff card, and a secret tool not mentioned anywhere in the instructions!

torxscrew

The surprise turns out to be a manner of fastening of which I was hitherto unaware – a TORX screw. TORX screws are used to hold the metal shield surrounding the drive in place, with the screw heads slotting into the bay runners – these must be removed from the old drive to fit the shield to the new drive.

Luckily I happened to have a #1 TORX bit in my tool kit, but finding an unfamiliar screw while a $3000 computer lies in bits on the dinner table is not an experience I wish to repeat.

driveinfo

After replacing the drive, I booted from the Leopard install disk, ran the Disk Utility to format the drive and then restored my data from my Time Machine drive. The end result is that my computer is set up exactly the same way as it was before, except I now have 250 gigs of free space to play with. Much better.

Movies in the New Zelanad iTunes Store

Apple has finally gotten its act together and added movies to the New Zealand iTunes store. Most older films are available to both rent and download outright, and the selection seems pretty good if not totally complete. The prices are not too bad either, you can definitely do better but they are not outrageously high.

Still no TV episodes though – what’s up with that?

Safari 3.1

The browser wars are starting to hot up again. Apple is making a late play for cross platform browsing by releasing Safari 3.1 onto the world. Safari is MacOS X’s bundled browser – on the Mac it has always been pretty good, but the recent Windows versions have been terrible. Safari 3.1 is actually decently stable, and introduces Windows users to some nice features.

For a start, even on Windows Safari uses the Mac’s font rendering technology. Although opinions differ, I much prefer the Mac’s method of rendering fonts, to my eyes it is easier to read and more attractive. By comparison, standard GDI fonts in other Windows applications look spidery and harsh.

Safari’s other claim to fame is diligent adherence to up to date web standards. Features such as the canvas tag and SVG images are built in. Even better, advanced CSS properties such as animation and transforms allow for some cool effects – and some lame ones.

The Windows version of Safari does have some problems. A long standing issue is Safari’s reluctance to work with HTTP proxies. 3.1 is better than previous versions but still displays a distressing preference for crashing in a heap. Connecting directly to the internet works fine however.

It is hard to see exactly what Apple is trying to achieve with the Windows version of Safari. It seems unlikely that Safari will gain much traction against IE and Firefox (especially with Firefox 3 on the horizon). I suspect that Windows Safari is mainly intended for web developers – the more people who have access to Safari the more likely websites will be developed that work properly with Apple’s browser – including the all important iPhone. In any case, having another option, especially such a capable one, is not a bad thing.

Mac OS X Version 10.5.2

I just installed the latest patch for Mac OS X on my MacBook. It fixes a whole host of things, almost none of which I ever found to be a problem.

First the bad news – the update take a very long time. First there is 5 minutes of watching a progress bar (no problems here), then there is a reboot and 5 minutes of watching an alarmingly blank screen, than another reboot and then another 5 minutes of blank screen before at last being dumped unexpectedly back at your desktop. This is not quite the Apple experience I signed up for when I bought my MacBook.

The good news is that 10.5.2 seems great so far. A few cosmetic issues have been fixed and the desktop seems a little snappier, probably due to the new graphics driver that is included.

MacOSX Leopard – Time Machine

Talk about bad luck! The week before Apple’s latest and greatest operating system is released, my MacBook hard drive decides it can no longer go on living. As I result, I have lost a years worth of email and photos just days before. If the hard disk had waited just a few more days then everything would have been safely backed up using the new Time Machine feature in MacOSX.5.

Let me begin by saying that Time Machine is not the last word in backing up, you can definitely buy better software. However, Time Machine may well be the prettiest piece of software ever created for any purpose whatsoever, so much so that I am actually looking forward to accidently deleting something in the future.


Time Machine Restore Screen
Restoring files with time machine, pity you can’t see the moving starfield in the background

Although it looks great, and works well, Time Machine is a little strange compared to other backup tools. The Mac filesystem has no equivalent to Windows’ Volume Shadow Services, so you cannot literally roll back a folder transparently. What Time Machine does is take periodic snapshots of your entire hard disk and stores it on another volume, usually some type of removable USB drive.

The first backup you take is basically a copy of your entire filesystem (the files are not compressed and can actually be accessed in the finder). Every half hour after that, time machine will create a new backup directory and copy any files that have changed.

Much of the implementation is done with UNIX-style links to directories, so that files that have not changed since the last backup are not re-copied. This has some important implications (both good and bad) that I have not seen mentioned anywhere else:

GOOD: The entire filesystem is stored so it is simple to do a complete recovery if your entire hard disk fails.

GOOD: The backup directory structure is so simple that you don’t even really need the fancy flying-through-space GUI to get your files back.

BAD: Links to folders are not supported on any other filesystem other than MacOS. This means you have to reformat your backup drive. Which leads to:

BAD: Very limited network support. Wouldn’t it be awesome to have everything backed up to a network share? Why yes, yes it would! Well you can’t – unless your network share supports links to folders – which it doesn’t (well, if you are running your share off Leopard Server it does – but you get the point).

BAD: Backups are only done every half an hour hourly, and only 1 backup is kept for each day earlier than 24 hours ago. Other backup tools backup every file as soon as it is saved.

GOOD: Unless you are stupid and backup to another partition, your backups are on a different physical drive that will hopefully survive whatever calamity that destroyed your data.

Although it is not the mythical perfect backup software, Time Machine is a very useful addition to MacOS. The very fact that it is bundled with the OS and very easy to set up is sure to save many hours of tears and frustration for Mac users.