Objective-C: raise exception

E.g.

[NSException raise:@”Invalid key value” format:@”Key value: ‘%@’ is invalid”, key];

A note of caution:

In Objective-C, unlike many similar languages, you generally should try to avoid using exceptions for common error situations that may occur in normal operation.

http://stackoverflow.com/questions/324284/how-to-throw-an-exception-in-objective-c-cocoa

Leave a Reply

Your email address will not be published. Required fields are marked *