How do you convert an iPhone OSStatus code to something useful?

前端 未结 19 1561
执念已碎
执念已碎 2020-12-05 01:45

I am getting more than a little sick of this iPhone SDK and its documentation...

I am calling AudioConverterNew

in the documentation under Returns: it says \

19条回答
  •  爱一瞬间的悲伤
    2020-12-05 02:10

    This is available on macOS and for iOS from 11.3 and above.

    I know this is an old post, but I was reading the apple docs in a section related to keychains. They mention a method that is used to convert OSStatus errors into something readable.

    SecCopyErrorMessageString

    Returns a string explaining the meaning of a security result code.

    SecCopyErrorMessageString (OSStatus status, void* reserved );

    Useage:

    NSString* ErrMsg = (__bridge_transfer NSString *) SecCopyErrorMessageString(theOSStatusError, NULL);
    

    It worked for me with my keychain OSStatus errors. Does it work for you? You will need Security.Framework added to your project to use this method.

提交回复
热议问题