Instance Method

initWithName:reason:userInfo:

Initializes and returns a newly allocated exception object.

Declaration

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

Parameters

name

The name of the exception.

reason

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

userInfo

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.

Discussion

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.