Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is OSStatus?

For example:

OSStatus AudioServicesCreateSystemSoundID (
   CFURLRef       inFileURL,
   SystemSoundID  *outSystemSoundID
);

In the Apple's documentation description of this function tells us that the returned value is a "result code". But what code? Why is it "OSStatus"?

like image 256
user2553675 Avatar asked Jan 11 '14 16:01

user2553675


People also ask

What is Osstatus error on Mac?

what does this error mean? It usually indicates a file (or directory) cannot be found—i.e. a referenced pathname is incomplete or incorrect.

What is Osstatus error?

Over the past few days, some of our users have reported to us that they have encountered a list of osstatus error codes. What does this error mean? This usually indicates that the registry (or directory) cannot be found, i.e. the particular path specified is incomplete or incorrect.


1 Answers

As you've said, it's the result code of the function.

Hovewer, different functions have different result codes that you can handle as you wish. for example, for Audio services, the current OSStatus codes are give in the documentation as:

enter image description here

So as you call your functions, you check the returnes OSStatus and if it's noErr (which is what 0 is), then you can continue with your next call, otherwise you handle the error accordingly.

like image 69
Abizern Avatar answered Sep 27 '22 19:09

Abizern