user2553675
user2553675

Reputation: 535

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"?

Upvotes: 19

Views: 31327

Answers (1)

Abizern
Abizern

Reputation: 150615

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.

Upvotes: 23

Related Questions