openURL的使用方法:
openURL的使用方法:
view plaincopy toclipboardprint?
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:appString]];
其中系统的appString有:
1.Map http://maps.google.com/maps?q=Shanghai
2.Email mailto://myname@google.com
3.Tel tel://10086
4.Msg sms://10086
openURL能帮助你运行Maps,SMS,Browser,Phone甚至其他的应用程序。这是Iphone开发中我经常需要用到的一段代码,它仅仅只有一行而已。
- (IBAction)openMaps {
//打开地图
NSString*addressText = @"beijing";
//@"1Infinite Loop, Cupertino, CA 95014";
addressText =[addressTextstringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSString*urlText = [NSStringstringWithFormat:@"http://maps.google.com/maps?q=%@",addressText];
NSLog(@"urlText=============== %@", urlText);
[[UIApplicationsharedApplication] openURL:[NSURL URLWithString:urlText]];
}
- (IBAction)openEmail {
//打开mail // Fire off an email to apple support
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"mailto://devprograms@apple.com"]];
}
- (IBAction)openPhone {
//拨打电话
// CallGoogle 411
[[UIApplication sharedApplication] openURL:[NSURLURLWithString:@"tel://8004664411"]];
}
- (IBAction)openSms {
//打开短信
// Text toGoogle SMS
[[UIApplication sharedApplication] openURL:[NSURLURLWithString:@"sms://466453"]];
}
-(IBAction)openBrowser {
//打开浏览器
// Lanuch any iPhone developers fav site
[[UIApplication sharedApplication] openURL:[NSURLURLWithString:@"http://itunesconnect.apple.com"]];
}
iphone程序内调用谷歌地图
使用CLLocationManager类,MKMapView。并且实现<MKMapViewDelegate,CLLocationManagerDelegate>
//初始化CLLocationManager,CLLocationManager获得当前地理坐标
locmanager=[[CLLocationManager alloc]init];
[locmanager setDelegate:self];
//设置精确度
[locmanager setDesiredAccuracy:kCLLocationAccuracyBest];
[locmanagerstartUpdatingLocation];
执行完以后,会自动调用代理方法:
openURL的使用方法:的更多相关文章
- openURL的使用方法
openURL的使用方法 openURL的使用方法: view plaincopy to clipboardprint? [[UIApplication sharedApplication] open ...
- iOS9 application:application openURL: sourceApplication: annotation: 方法不执行
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url NS_DEPRECATED_IOS(2_0, 9 ...
- (转)openURL的使用方法
view plaincopy to clipboardprint? [[UIApplication sharedApplication] openURL:[NSURL URLWithString:ap ...
- app跳转openURL,兼容方法
- (void)openScheme:(NSString *)scheme { UIApplication *application = [UIApplication sharedApplicat ...
- Unity iOS打开AppStore评星页面,浅谈Application.OpenURL()方法。
http://fairwoodgame.com/blog/?p=38 Unity iOS打开AppStore评星页面,浅谈Application.OpenURL()方法. Posted in Uni ...
- (译)openURL 在 iOS10中已弃用
翻译自:openURL Deprecated in iOS10 译者:Haley_Wong 苹果在iOS 2 推出了 openURL:方法 作为一种打开外部链接的方式.而与之相关的方法 canOpen ...
- OpenURL的一些用法
openURL的使用方法: view plaincopy to clipboardprint? [[UIApplication sharedApplication] openURL:[NSURL UR ...
- easyUI 如何不跳转页面,只是加载替换center部分内容
以前做的一个故障报修系统,前端框架使用easyUI框架,layout布局,center使用datagrid .点击左边树形菜单时时页面跳转,想要知道如何点击菜单时不进行页面跳转,而是只对center模 ...
- iOS开发200个tips总结(一)
tip 1 : 给UIImage添加毛玻璃效果 func blurImage(value:NSNumber) -> UIImage { let context = CIContext(opti ...
随机推荐
- Lvs原理
官方文档: http://www.linuxvirtualserver.org/zh/lvs1.html http://www.linuxvirtualserver.org/zh/lvs2.html ...
- mysql 在linux 修改账号密码
1.root用户登录到mysql数据库代码示例:/usr/local/mysql/bin/mysql -u root -p (输入密码进入mysql)2.进入mysql,输入:代码示例:use mys ...
- Java多线程基础知识(二)
一. Java线程具有6种状态 NEW 初始状态,线程被创建,但是还没有调用start方法. RUNNABLE 运行状态,java线程将操作系统中的就绪和运行两种状态笼统的称作进行中. BLOCKE ...
- 深入理解Java虚拟机之读书笔记四 性能监控与故障处理工具
JDK的bin目录下存在很多有效的命令行工具,它们就是jdk\lib\toos.jar类库的封装. 一.jps:虚拟机进程状况工具,查询出LVMID. 二.jstat:虚拟机统计信息监视工具, 三.j ...
- HDU 5007 Post Robot KMP (ICPC西安赛区网络预选赛 1001)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5007 解题报告:输入一篇文章,从头开始,当遇到 “Apple”, “iPhone”, “iPod”, ...
- Interleaving String leetcode
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = ...
- 2016年11月10日--CSS动画
jquery动画:http://www.w3school.com.cn/jquery/jquery_animate.aspCSS3动画教程1:http://www.w3school.com.cn/cs ...
- The Adapter of ListView: Just adapt data to view, don’t do anything else
The design of SimpleAdapter is not good in my opinion. An adapter should just adapter the data to vi ...
- UICollectionView + AFNetWorking 异步加载,局部刷新.
最近在做的项目需要cell里面的数据需要和后台实时交互.而collectionview reload会整体刷新. //m层 发送通知 [[NSNotificationCenter defaultCen ...
- zaqar项目介绍
Zaqar is a multi-tenant cloud messaging and notification service for web and mobile developers. It c ...