setStringValue not clearing the screen ???

January 20th, 2009

I had this strange bug: Setting the string value of a NSTextField wasn’t removing its previous value before drawing the new one. The net result was a mess on the screen, and it was happening randomly.

Of course, I started by blaming Cocoa… I tried using setNeedsDisplay to no avail. Even marking the whole window as needing a refresh didn’t work.

So I stopped, and thought about the randomness. Seems a bit like a race condition… And then I realised my code was running in a sub-thread. Using performSelectorOnMainThread to update the UI once the thread had completed fixed the bug.

Tetratile Video

November 20th, 2008

Tetratile is now available at the Apple Store
I’ve just made a small video of Tetratile in action.


November 20th, 2008

Apple has just approved my iPhone/iPod game Tetratile. It’s a board game which requires you to line four tiles up in a row, a column or a diagonal. You insert pieces from the right or the bottom, so each move changes the configuration of the board. This makes Tetratile quite challenging and addictive.

I think Tetratile will prove to provide many hours of entertainment as each level of difficulty requires an even better understanding of the game.

Here’s a picture of a game in progress:

As you can see the red player is one step away from winning.
The lower bar shows that the red player won the first game, and the blue player won the second.

You can play against the iPhone/iPod, or against a friend.

You play by dragging tiles onto the board. Notice that you can drag from the center of a column or row, as well as from the edge.

Tetratile will be available for a week at an introductory discount of $3 and then it will go up to $5. I hope you like it!

P.A. Semiconductor to focus on the iPhone

June 11th, 2008

The New York Times reports that P.A. Semicondutor will be making systems on a chip for the iPhone platform. So I got this wrong.

Stunning use of Javascript

June 5th, 2008

Slides, a mac like tool in JS. It uses Objective-J, a Objective-C like language. And according to the authors, the framework will be open-sourced.

Two Iphone CPU Architectures?

May 15th, 2008

Intel’s managing director responsible for Germany has apparently revealed that there will be 2 iPhones, one based on an ARM processor and the other on Intel’s Atom processor.

Perhaps this explains this WWDC picture:

(image courtesy of computer world)


May 15th, 2008

As you may know, Find It! Keep It! is not yet self-supporting, so I also work part-time on a 3D geo-browser called earthscape. Its outing party was yesterday (video)

One of the applications is to help helicopter pilots (e.g. search and rescue) figure out where they are.

There’s also a desktop version which should be available real-soon-now ™. Unlike competing products, it is highly programmable in Javascript. Although there’s no Mac port yet, there is an early iPhone port.

Apple buys P.A. Semiconductor

April 23rd, 2008

At the time Macs started using x86 cores, an alternative to stay PowerPC was to use P.A. Semiconductor’s chip. At the time (2005), it would have been a risky move as P.A. Semiconductor didn’t yet have working silicon. Today however, Apple bought P.A. Semiconductor.

A Desktop Part

What’s interesting is that P.A. Semiconductor’s part, the PA6T, is a desktop part, not something that would fit into an I-Phone.

Wattage: The IPhone’s CPU uses quarter of a watt (it’s either a Samsung S3C6400 or a close derivative). The PA6T uses between 5 and 13 watts, and in the worst case 25W. While this is lower than an Intel desktop chip, it would take too large a battery to fit in a phone.

Memory Bus: The PA6T has two CPUs, each with its own DDR2 bus. That’s a lot of pins, and a lot of memory chips — not something that fits into a phone.

I/O: 8 PCIe controllers, 2×10Gb ethernet controllers, 4×1Gb ethernet controllers. None of this is needed by a phone.

CPU: Two 2GHz PPCs for the 5-13 Watt Core… Apparently future versions will run at 2.5 Ghz, and provide up to 8 cores on a die. Again overkill for a phone.


Although it’s possible that P.A. Semiconductor has another IPhone specific chip in the works, my guess is that the next MacBook Air will use this part. The MacBook Air uses a 20W part, and a 37W hour battery. As a rough calculation, 17W for the system, 20W for the CPU becomes 22W with a 5W CPU, and 20W for a system with a solid state drive. That gives you almost 10 hours of battery life.

This is another step in Apple’s strategy of owning the whole system, letting it chart its own course, although I expect it to continue using commodity x86 chips for lower end systems. For developers, it means we’ll be making FAT binaries for some time yet, even if it does mean more work.

Some members of crowds are wise…

April 11th, 2008

The latest flutter on the internet is concern about the reflection in Dick Cheney’s glasses.

United Press International (UPI) just published a story of an expert who used the latest digital technology to conclude “In one lens of his sunglasses you can clearly tell it is a sleeved arm of Cheney or a fishing companion”.

Reddit published a link to the full-sized version two days ago (of course the comments leave much to be desired).

Given the recent news on Bear-Stearns…

March 20th, 2008

…I find this video rather prescient. (British humour warning).