在iphone程序打开其它程序(Launching Other Apps within an iPhone Application)
2012-04-27 18:37
323 查看
你可以使用openUrl打开一些程序,不只是浏览器,我们将在下面的例子中演示这些这些应用:
打开浏览器
打开google map
打开email
拨号程序
发短信程序
打开appstore
Launch Google Maps
到googlemap的URL格式是:
你可以更改QUERY_STRING改变位置信息:
打开Apple Mail
格式:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://info@iphonedevelopertips.com"]];
拨打电话(iPhone Only)
格式:
发短信
格式
打开app store
打开appstore的程序位置,右键点击程序图标获取url
格式如下:
打开浏览器
打开google map
打开email
拨号程序
发短信程序
打开appstore
Launch Google Maps
到googlemap的URL格式是:
http://maps.google.com/maps?q=${QUERY_STRING}
你可以更改QUERY_STRING改变位置信息:
NSString* searchQuery = @"the postion I want to know"; searchQuery = [searchQuery stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; NSString* urlString = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@", searchQuery]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]]; |
格式:
mailto://${EMAIL_ADDRESS}
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://info@iphonedevelopertips.com"]];
拨打电话(iPhone Only)
格式:
tel://${PHONE_NUMBER}
1 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://8004664411"]]; |
格式
sms:${PHONENUMBER_OR_SHORTCODE}
1 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:55555"]]; |
打开appstore的程序位置,右键点击程序图标获取url
格式如下:
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=291586600&mt=8
12 | NSURL *appStoreUrl = [NSURL URLWithString:@"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=291586600&mt=8"]; [[UIApplication sharedApplication] openURL:appStoreUrl]; |
相关文章推荐
- 在iphone程序打开其它程序(Launching Other Apps within an iPhone Application)
- 在iphone程序打开其它程序(Launching Other Apps within an iPhone Application)
- 在iphone程序打开其它程序(Launching Other Apps within an iPhone Application)
- Launching Other Apps within an iPhone Application
- Launching Other Apps within an iPhone Application
- Launching the App Store from an iPhone application
- Launching Your Own Application via a Custom URL Scheme(在短信链接中打开你的程序并且给你的程序发送消息)
- django-cron - A Django application that will run cron jobs for other django apps - Google Project Hosting
- 打开串口失败! Chinese:串口已被其它程序打开或该串口不存在
- iOS开发笔记(八)How to test an iPhone application update?
- iphone程序启动互相调用, 打开其他程序
- iphone程序启动互相调用, 打开其他程序
- 检测iphone是否安装有某个程序,或者打开某个程序openURL CanOpenURL
- Mac之Launching an Application
- iphone程序中打开网页
- 打开窗口的方法,设定对象的颜色,程序退出,按钮或其它对象加超链接
- windows C/C++ 在一个程序中打开,关闭和监视其它的exe程序
- iphone程序启动互相调用, 打开其他程序
- c++运行程序时出现“This application has requested the Runtime...in an unusual way”
- 利用OpenURL打开另一个iPhone程序