04 November 2007

Programming in Leopard

As a developer, getting to use Leopard on a daily basis means getting to use Xcode 3.0 on a daily basis. I’m pretty happy with this update, though some of the changes simply take a bit of getting used to. The new SCM integration is much better, though it also introduces the concept of a project root. SCM applies to all files in the root. With Opal, this isn’t a problem. With a GameHouse game, it is, because each game uses 4 libraries and one game-specific folder from the root. Getting SCM info for the other 50 game-specific folders takes a lot of time, and showing said info confuses things.

It’s a little disconcerting that rebuilding a Cocoa application changes its behavior. For example, Opal’s Export as command used NSExportableAs to specify the possible types. Under Leopard, this requires the use of UTIs, which Opal didn’t use. So Export as (which worked fine in Leopard) broke as soon as I rebuilt. Another change was the preview pane in Print dialogs. This showed up only after I rebuilt in Leopard. That was cool, new behavior for free! Except it wasn’t quite right. So I had to figure out how to hook Opal’s print dialog controls so that they updated the preview. Bottom line: an application that works fine in Tiger may require significant work as soon as you touch it under Leopard.

I haven’t seen anything similar in the Carbon world (which GameHouse games use).


Chris Hanson said...

Actually, just rebuilding in Leopard shouldn't change your application's behavior; only switching to the 10.5 SDK (or building against the Current System, which isn't recommended) should do that.

If you stick to the 10.4 Universal SDK, you should see exactly the same behavior as before. It's only once you start implementing Leopard features — and therefore using the 10.5 SDK — that you'll need to adapt your code to 10.5-specific changes like the use of UTIs as document types.

David Dunham said...

You're right. I had switched to the 10.5 SDK in preparation for adding things like Quick Look.

But, the release note says, “ Thus, as a result of relinking your application on Leopard or against Leopard SDK, you might notice different behaviors” — just relinking is supposedly enough.