IOS异常问题

(IOS)解决openUrl延时问题

2018-08-09  本文已影响0人  rightmost

// 方法一

dispatch_async(dispatch_get_main_queue(), ^{

    UIApplication *application = [UIApplication sharedApplication];

    if([application respondsToSelector:@selector(openURL:options:completionHandler:)]) {

        [application openURL:URL options:@{}

           completionHandler:nil];

    }else{

        [application openURL:URL];

    }

});

// 方法二

[selfperformSelector:@selector(redirectToURL:) withObject:url afterDelay:0.1];

- (void) redirectToURL

{

    UIApplication *application = [UIApplication sharedApplication];

    if([applicationrespondsToSelector:@selector(openURL:options:completionHandler:)]) {

        [application openURL:URL options:@{}

           completionHandler:nil];

    }else{

        [application openURL:URL];

    }

}

上一篇 下一篇

猜你喜欢

热点阅读