Search code examples
objective-ciphonexcodedebuggingjailbreak

does using try catch block in xcode show error on real device?


my application is running fine in simulator...but not on real device....and i have jailbroken iphone so i am unable to debug through device...if i use try catch something like this

@try
{
Statements
}

@catch (NSException *ex) {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:[NSString stringWithFormat:@"%@",ex]
                                                   delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
    [alert show];
}

will my application show error on alertview before crashing?

if not how could i find where is the bug?


Solution

  • Catching the exception means you are doing something in response to this "error" coming about and it wont crash the application , thats the point of catching exceptions-to tell how to handle cases where errors arrise so your app wont crash, so yes the alert view will show...