I have faced a tough problem.
NSURL *url = [NSURL URLWithString:@"numberplate://"];
if([[UIApplication sharedApplication] canOpenURL:url]){
NSLog(@"it can");
}
Just create a empty project, insert the codes above into the method of didFinishLaunchingWithOptions
in appdelegate.m
I run it on simulator, it runs ok. I run it on my Device,iOS 7.0.4, it crash.
But i run it on other people's device, it runs ok.
So, the problem is just occur on my device.
Also, if I change the string @"numberplate://"
to any other strings, it also runs ok.
Has anybody faced this problem?
==========add edit=============
@demosten
@try {
NSURL *url = [NSURL URLWithString:@"numberplate://"];
if([[UIApplication sharedApplication] canOpenURL:url]){
NSLog(@"success");
}
}
@catch (NSException * e) {
NSLog(@"Exception: %@", e);
}
@finally {
NSLog(@"finally");
}
I change the code like this. But it can not catch the exception.