ios捕获异常

@try 
Statements 
@catch (NSException *ex) { 
        UIAlertView *alert = [[UIAlertView alloc] 
                                     initWithTitle:[ex name] 
                                     message:[ex reason] 
                                     delegate:self 
                                     cancelButtonTitle:@"OK" 
                                     otherButtonTitles: nil]; 
                                     [alert show]; 

你可能感兴趣的:(ios捕获异常)