This question already has answers here:
Closed 6 years ago.
I can easily find noErr = 0
in the OS X library source code. But it's pretty hard to find a full list of error code for OSStatus
on iOS.
On Mac OS X, it's not that hard to find stuff like
kAudioHardwareUnsupportedOperationError
But I can't seem to find useful info for iOS OSStatus codes. It would be nice to have a full list of them or any pointers to the header files that define them.
Thanks!
UPDATE:
I don't think my question is a duplicate of the above question. The op of that "possible duplicate" question wanted to convert the 4-char codes he already knew into human-readable strings. Instead, here is my further spec:
I don't even know what 4-char or typedefed integers to use for iOS.
I'd like to see something like a full list of codes, like you would normally see in many C++ framework/library design, e.g., an enum list, or standard exceptions, or even the OSX k-something codes, which at least can be found in the Xcode docs alone.
My usecases of these codes include:
In my custom functions, e.g., some CoreAudio callbacks that have to return OSStatus, I'd like to return these built-in human-readable codes to indicate the types of runtime errors. Without the list, I don't know what to return, other than noErr.
Apparently, many OSX k-codes are undefined under iOS environment so they can't be used transparently.
UPDATE (CONCLUSION):
I finally found a clue: Search for keyword "Result Codes" in Xcode documentation (Organizer) and we get more or less categorized return codes documentation sections in the "System Guides" result. This is good enough for my original question. –
The best I can do to help is provide the results of using find
from the command line:
$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
$ find . -name \*.h -exec fgrep -l OSStatus {} \;
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioConverter.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFile.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFileStream.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFormat.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioQueue.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioServices.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioSession.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AUGraph.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/MusicPlayer.h
./System/Library/Frameworks/AudioUnit.framework/Headers/AUComponent.h
./System/Library/Frameworks/AudioUnit.framework/Headers/AudioComponent.h
./System/Library/Frameworks/AudioUnit.framework/Headers/AudioOutputUnit.h
./System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnitProperties.h
./System/Library/Frameworks/AudioUnit.framework/Headers/MusicDevice.h
./System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h
./System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h
./System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMAudioClock.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMBase.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMBlockBuffer.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMBufferQueue.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMFormatDescription.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMSampleBuffer.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMSimpleQueue.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMSync.h
./System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIDriver.h
./System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h
./System/Library/Frameworks/CoreMIDI.framework/Headers/MIDISetup.h
./System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIThruConnection.h
./System/Library/Frameworks/Foundation.framework/Headers/NSError.h
./System/Library/Frameworks/MediaToolbox.framework/Headers/MTAudioProcessingTap.h
./System/Library/Frameworks/Security.framework/Headers/SecBase.h
./System/Library/Frameworks/Security.framework/Headers/SecIdentity.h
./System/Library/Frameworks/Security.framework/Headers/SecImportExport.h
./System/Library/Frameworks/Security.framework/Headers/SecItem.h
./System/Library/Frameworks/Security.framework/Headers/SecKey.h
./System/Library/Frameworks/Security.framework/Headers/SecTrust.h
./System/Library/Frameworks/Security.framework/Headers/SecureTransport.h
./usr/include/AssertMacros.h
./usr/include/Endian.h
./usr/include/MacTypes.h