Wednesday, April 29, 2009

What could error code 560030580 means?

When Apple use the error enumerations, it used a fancy cool tip to define the error code. (I would like to call this magic error number, whatever apple call it.)

Just look at this:

kAudioFormatUnsupportedDataFormatError 1718449215 = ‘fmt?’
The playback data format is unsupported (declared in AudioFormat.h).
Available in iPhone OS 2.0 and later.


When you run you app and get an error code, the only thing you could see in the console is an error number like 1718449215 or 560030580, if you don't know what this magic number is, you would have no idea what this f**king number is. But if you paste this number to calculator app(I mean the system calculator application as below), you would see the real meaning in these number.

[caption id="attachment_259" align="aligncenter" width="362" caption="Paste the magic error number and see the real meaning"]Paste the magic error number and see the real meaning[/caption]

Did you see? in the left down corner, there is an string "!act" that's what this number means.

The main idea behind this magic error number is how to interpret the 4 bytes int32 data type. When we define a number in C or in C++ and Obj-C, you can say:

Int32 a = 'abcd';


This is legal and cool, it gives every number an abbreviated meaning.

Well, Frankly, it is a good tip! But the nightmare is Apple did not use it everywhere, it just adopted some of these mechanism into the current iPhone API, especially, in CoreAudio, so if you find some error code is strange, just copy it, paste it to the calculator, see what you can get. It might be help.

No comments:

Post a Comment