Blog

Understanding error codes

Just in case there’s someone else that didn’t know this, when one gets an error code from one of the iPhone/OS X SDKs with no other information available, it can usually be looked up in the MacErrors.h header. Just open a terminal, type:

open -h MacErrors.h

Then do a search for your error code and you’ll hopefully find a corresponding macro name that gives some indication of what went wrong.

Failing that, if you have an inkling of where the error occurred (eg. the AudioToolbox framework), then you can often find the error defined within the framework’s headers:

$ grep -r '10863' /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/System/Library/Frameworks/AudioToolbox.framework/ /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUGraph.h: kAUGraphErr_CannotDoInCurrentContext = -10863,

That was, type in Terminal grep -r 'the error code', then drag the framework straight from XCode into the Terminal, where the path will be inserted.

Related posts

Tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use Markdown (surround code in `back-ticks`), or these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Subscribe without commenting