Instance Method


Initializes and returns a newly allocated exception object.


- (instancetype)initWithName:(NSExceptionName)aName reason:(NSString *)aReason userInfo:(NSDictionary *)aUserInfo;



The name of the exception.


A human-readable message string summarizing the reason for the exception.


A dictionary containing user-defined information relating to the exception

Return Value

The created NSException object or nil if the object couldn't be created.


This is the designated initializer.

See Also

Creating and Raising an NSException Object

+ exceptionWithName:reason:userInfo:

Creates and returns an exception object .

+ raise:format:

A convenience method that creates and raises an exception.

+ raise:format:arguments:

Creates and raises an exception with the specified name, reason, and arguments.

- raise

Raises the receiver, causing program flow to jump to the local exception handler.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software