Friday, 13 May 2011

iOS: The Enigma Squares (1.2)

The Enigma Squares version 1.2 is available in the App Store now. Amongst other excitement, it adds Game Center support. You can now share your achievements and high score with other players. Woo hoo.

So far, I'm very impressed at how far players have got. I'm glad the game is providing an interesting challenge!

More interesting updates are in the pipeline...

Thursday, 12 May 2011

iOS: Packaging apps store submissions from the command line (my zip broke)

How to package iOS apps for submission to iTunes Connect from the command line.

I'm a firm believer in the power of the command line. I like my GUI tools as much as the next man (as long as he's a bearded Unix guru from the 1970s). But for sheer power, repeatability and flexibility you just can't beat a good script.

Which is why every project I work on has to have a simple single script that configures, builds, and packages the code, creating a well-named payload that can be installed/submitted/deployed. I feel a lot safer about the quality of a release if it's generated by a tried-and-tested script, rather than by a series of button clicks in a series of separate tools.

You know it makes sense.

iOS projects submitted to the App Store are effectively zip files with a particular directory structure. You can drive Xcode with the xcodebuild tool to build and link your distribution version of an iOS app.

However, whenever I tried to zip the project up from the command line, the Application Loader utility (what you use to submit your app to iTunes Connect) just gave bizare errors.
The CodeResources files must be a symbolic link to _CodeSygnature/CodeResources. Make certain that the bundle is on a locally-mounted volume...
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate.
Well, that's nice gibberish. Not.

However, a zip archive created using the Finder's "Compress" menu entry worked fine. Very frustrating.

Don't fear! I fixed it. Here's how to do it in your very own build script: your zipper is broken; throw it out. Use ditto instead. Here's the line from my build script:
APP_FILENAME=/path/to/build/Application.app
PACKAGED_FILENAME=MyGoodPackagedFilename.zip
ditto -c -k --keepParent --rsrc "$APP_FILENAME" "$PACKAGED_FILENAME"

Enjoy your build scripts.

Thursday, 5 May 2011

Becoming a Better Programmer

My Becoming a Better Programmer presentation given at ACCU 2011 has been very popular recently. It's one of the most-viewed presentations on slideshare this month.

At the time of writing, there have been more than 12,500 views of the entire presentation.

That is both exciting and flattering - and nice to know that developers truly do care about improving their skills. And nice to know that I have been able to help.

Check it out here.

Writing: Relish the Challenge

The May issue of ACCU's C Vu magazine will be hitting doormats any moment now. It contains the latest instalment in my Becoming a Better Programmer column. This one's called Relish the Challenge, and is an encouragement to stay motivated and challenged, to seek out new things, and to avoid becoming stale and staid as a developer.

I hope it's useful. For your stimulation, I've added the final questions from the article to the end of this blog post.

The PDF version of the magazine will be available for download by ACCU members shortly.

The cover I created for this month's issue is quite dense and busy. I wonder if that's any reflection on the designer?



Questions
  1. Do you have projects that challenge you and stretch your skills?
  2. Are there some ideas you’ve thought about for a while, but not started? Why not start a little side-project?
  3. Do you balance ‘interesting’ challenges with your ‘day to day’ work?
  4. Are you challenged by other motivated programmers around you?
  5. Do you have a broad field of interest that informs your work?

Wednesday, 4 May 2011

iOS: The Enigma Squares

My first personal iOS project has finally seem the light of day. Please welcome into the world The Enigma Squares. It's an interesting (and dare I say it) entertaining block-moving puzzle game.

Check it out on iTunes here.

I've produced plenty of iOS projects for my company. But this has been an entertaining personal side-project, to keep me busy through those long spring evenings.

It is actually a version of a game I first wrote (ahem) 20 years ago. Back then it was written for the Acorn Archimedes, and I sold it to a magazine for inclusion on their cover disk (remember those?) This version is a little more polished, a little more challenging, and a lot more fun.

The code's a fair bit better too, but that's another story. One that I'm sure I'll tell one day...

Let me know what you think of it!

Wednesday, 20 April 2011

Code: Gibberish++

I love C++.

And I hate it.

Whenever I pick up my C++ compiler, it feels like I'm coming home. It's a wonderfully powerful language, and one that, in the hands of the experienced, can be used to craft exquisite code. It can also be made to construct a bloody mess. Literally.

It's a sharp tool. With sharp edges. Whenever you pick it up, you realise that you have a sharp tool already covered in the blood of previous unfortunate users.


The language ranges from the sublime to the ridiculous, through fields of the inexplicable, unusable, and unreadable.

A great example of the gibberish end of C++'s spectrum is this example given me be a colleague.

What does the following code print?:
using namespace std;
int x = 50;
cout << setw(8) << setfill('0') << showbase << hex; cout << x << endl;
Any guesses?

The answer is: 00000x32. Um, handy.

What you have to say is this:
using namespace std;
int x = 50;
cout << setw(8) << setfill('0') << internal << showbase << hex; cout << x << endl;
To get: 0x000032.

Iostreams. Gibberish++

Tuesday, 19 April 2011

Speaking: ACCU 2011 slides available

The slides from all of my ACCU 2011 talks are now available for your viewing pleasure on SlideShare.

Find them here:

If you're interested in me giving these talks for you, then get in touch.