Thursday, 5 February 2009

Universal Binary

I just copied moneyLounge across to my old Mac G5 and, too my horror, discovered that it wouldn't even startup. I was getting the message "invalid architecture". Some hunting around on google quickly determined that I needed to compile a universal binary version of moneyLounge. This is done simple by changing the "Architectures" setting in the Build properties of the target. I'll guess this means I'll need two targets from now. All went well except for one interesting (and hard to track down) run error. This concerns the use of code such as:

int row;
if(row==NSNotFound) then ....

In the native architecture of my Intel Mac this code would work fine, but in the 32/64 bit Universal version it didn't. This was because NSNotFound is defined as the largest possible long datatype rather then integer. I guess this is the difference between the 32 and 64 bit versions. The upshot of this was that I recoded all my "int" datatypes to NSUInteger, making the code a lot more generic in any case. Something to bear in mind I guess - try and use the NS datatypes rather then the simple C versions.

Tuesday, 3 February 2009

Number Invaders


moneyLounge has reached a stable build now and I'm actually able to use it for my day to day finances. That means I finally have a replacement for MS Money on the Mac that I can actually use. There's still a few bits and pieces that could be improved upon and I intend over the next few days to test the release on my G5 and also give it to a few users to beta test. But for the past couple of weeks I've been happily working on my first iPhone Project - Number Invaders. It's a simple game based on the old 1980 Casio Calculator game where you 'shoot' numbers advancing across the LED display towards you, and it has turned out to be an ideal introduction project to iPhone development, as it involves simple graphics, timing events and GUI development. The actual coding is very similar to standard Mac Cocoa and Objective-C and so far the hardest part has been getting the setup and configuration working. If you're intended to join the iPhone developer program and setup your Mac then I would encourage you to visit Ralf Rottmann's guide as he takes you past all the potholes that Apple has often neglected to document. I now need to get Calculator Invaders ready for the App Store and I'll try to be a little more regular at updating my blog of with what happens thru the Apple QA process.