[NSException new]
instantiates a null
class because it contains no useful information. It does not generate an NSException
instance, and as such your:
@catch (NSException *ex)
{
NSLog(@"exception caught");
}
is useless. However, if you use:
@catch (id exception)
{
}
You will catch this empty object.
An excerpt from the official documentation on Handling Exceptions:
You can have a sequence of @catch error-handling blocks. Each block
handles an exception object of a different type. You should order this
sequence of @catch blocks from the most-specific to the least-specific
type of exception object (the least specific type being id) ...