When mistakes come back to haunt you

A nasty bug has just shown up in Fare City and bitten several unfortunate players, some of whom are now rather upset! You can read all about the problem, how we are trying to get it resolved and the current workaround in the FAQ. Here I want to explain what went wrong…

The game includes a global leaderboard. This is hosted by the very generous cocosLive team. In the game it is displayed in a control called a UITableView. Now, as I began implementing this feature I hit a little problem. The first thing a UITableView needs to know is how many entries it has. However, the cocosLive APIs didn’t seem to support a call that would give me the number of entries in the leaderboard.

(At this point I should add a disclaimer – this describes my experience during development. It may not reflect the true situation with these components. I will be checking into this more when I have a chance and will update accordingly.)

To get around this technical gap I decided that I would just give a fake table size to begin with and then figure out the actual size if the player attempted to scroll of the bottom. To test I set the initial number to 200, fully intending to change it to something more sensible later…

…So, of course, I forgot all about it. Everything was working fine, even when we populated the table with a hundred test scores. Only after the game shipped and the leaderboard passed the 200 mark did I notice that you couldn’t scroll down to the bottom anymore.

I was pretty annoyed that I had left in this stupid limitation but it didn’t really seem that big a deal. So I worked on a few fixes and changes for 1.0.1 and submitted it to Apple on Friday (as mentioned in my last post).

What I didn’t realize was that this simple mistake was about to blow up in spectacular fashion. A “nice little feature” of the leaderboard is that when you first load the board it shows where your score is. This is done be remembering the rank awarded to the score when it is submitted. Great, but suppose you have just played and achieved your new personal best and although it’s not super compared to the taxi-jocks out there you are proud of your achievement and submit it. And suppose that puts you at 385 in the table. And now the game switches to the leaderboard so you can see how things stand, and the game asks the UITableView to display line 385 – and the UITableView says “Exception: invalid argument”. And you are staring at your homescreen wondering what happened to your game!


Worse yet, when you go back in the stats don’t show your score so not only did it crash but it LOST YOUR SCORE!!!

The irony is that the score was successfully submitted to the leaderboard so if you were to view it on the website or at cocosLive you would see it. But as you can’t see it in the game because you can only see 200 entries, it looks like you’ve just wasted a little bit of your life that you will never get back.

I first began to hear noises about the crashing on Friday but by this morning it was apparent that there was a serious issue. I won’t bore you with the details of how I managed to diagnose the problem in the end but there is some good news to this tale of woe: because 1.0.1 fixes the 200-entry limitation it also, at a stroke, fixes the crash (which is why no one on the team spotted the problem – we were all busily testing 1.0.1).

So now the million dollar question is: when will Apple approve the fix?

One Response to “When mistakes come back to haunt you”

  1. I won’t have a word said against Apple! | Finkly Interactive Says:
    September 29th, 2009 at 22:50

    […] is all it took for Apple to respond to my plea regarding 1.0.1 (you can read the whole crisis here), review the update, and post it on the App […]

Leave a Reply