Objective-C: raise exception


[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.


Leave a Reply

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