Aleksandar • Vacić

iOS bits and pieces

The best season ending ever

Last year, Lewis Hamilton fucked up 17pts lead in the last two races. This year, he had 7pts over Massa and up until 2 laps from the end he looked to be the champion.

Then Vettel passed him and Hamilton did not have any chance to catch him. No chance at all and I was watching in horror how McLaren was going to lose the title again, at the end. I was so horrified that I did not even see that both of them passed Glock two corners from the end. Glock stayed on dry tyres while the rain fell and he barely kept the car - he was 1:44 in the last lap to Hamilton’s 1:24. Gamble from Toyota team that nearly gave them 4th place. Gamble of Toyota team that nearly destroyed McLaren’s year.

Lewis Hamilton wins the title!

I don’t think there was ever a championship decider like this. Man, I still can’t believe what happened. Absolutely amazing, thrilling, fabulous.

McLaren has the Champion, after so many, many years that I lost count. It’s time to celebrate.

Protected posts?

As I’m baby stepping through the iPhone SDK development, I encounter some strange stuff. Given the unfortunate (to say the least) circumstance of the NDA still in place as of this writing, I can’t post publicly about it. I can’t ask on forums nor would anyone be allowed to answer. That’s how NDA stuff works.

In order not to lose these stuff and to keep note of problem and solution (if I find one) for future benefit, I’m doing this password-protected posts that I will reveal once NDA is lifted.

Which hopefully will happen' at some point.

update: it did not take long - just days after I did this, Apple killed the NDA.

Confusing stuff: NSLog and SystemSoundID

In my first attemps with iPhone SDK programming – while working on Running Mate’s early proof of concepts – I tested the playing of short sound effects. That’s where I encountered this strange error:

warning: Unable to read symbols for "/System/Library/Frameworks/UIKit.framework/UIKit" (file not found). 
warning: Unable to read symbols from "UIKit" (not yet mapped into memory).

As you can see, this error is entirely meaningless on its own – if this was true, none of apps would work. Which was not the case. This happened with 2.1 final SDK, where I last checked for this.

It turns out that problem was with this line:

NSLog(@"Play sound: %@", _soundID);

where _soundID is of type SystemSoundID. Commenting this line out resolved the problem.

My guess here is that SystemSoundID does not have description properly implemented. %@ should cover any object that accepts description message, so it’s not strange that a beginner would try to log it as given above. And would be mightily confused by the message in the console window, as I was.

I got out of this by commenting out lines of code, one by one, starting from the last one I added.

Hopefully someone else will find this and saves oneself some time and nerves.