美文网首页iOS-VendoriOSiOS知识收录
【iOS】[UIApplication sharedApplic

【iOS】[UIApplication sharedApplic

作者: 刘大帅 | 来源:发表于2015-09-24 22:06 被阅读3723次

    摘抄自

    调用谷歌地图(Google Maps)

    NSString *searchQuery = @"1 Infinite Loop, Cupertino, CA 95014";  
    
    searchQuery = [addressText stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];  
    
    NSString *urlString=[NSString stringWithFormat:@"http://maps.google.com/maps?q=%@", searchQuery];  
    
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlText]];  
    

    调用邮件客户端(Apple Mail)

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://admin@eyecm.com"]];  
    

    拨号(Phone Number)

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://10086"]];  
    

    调用短信(SMS)

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:10086"]];  
    

    调用浏览器(Safari Browser)

    NSURL *url= [NSURL URLWithString:@"http://eyecm.com"];
    [[UIApplication sharedApplication] openURL:url];  
    

    调用应用商店(AppStore)

    NSURL *appStoreUrl= [NSURL URLWithString:@"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=291586600&mt=8"];
    [[UIApplication sharedApplication] openURL:appStoreUrl];  
    

    调用appstore中程序的评论

    NSString *str = [NSString stringWithFormat:
                             @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d",
                             m_appleID ];  
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];  
    

    相关文章

      网友评论

      • YimG:怎么判断这个是否执行啊?
        YimG:@就这样_a2c2 百度有,如何判断

      本文标题:【iOS】[UIApplication sharedApplic

      本文链接:https://www.haomeiwen.com/subject/czzicttx.html