The Blog

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:

C:
  1. 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.

Banca

Banca

Beautiful and functional currency converter, supports just about any currency in the world.

Go Couch to 5k

Go Couch to 5k

The most popular starter running program in beautiful feature-rich app (GPS tracking, charts, detailed history etc)

Quickie to do

Quickie to do

The fastest short-term task-list / check-list app on the App Store. Really.

Guerrilla Cardio

Guerrilla Cardio

The most challenging high-impulse interval training in the world.

Run Mate

Run Mate

A versatile running coach app, with unlimited number of running programs. Perfect for casual runners.

Leave a Comment

Add your comment here, just please be civilized and stay on topic.