iphone调用系统电话、浏览器、地图、邮件等
2012-07-06 10:23
330 查看
from:http://blog.csdn.net/hufeng825/article/details/7217404
openURL的使用方法:
view
plaincopy
toclipboardprint?
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:appString]];
其中系统的appString有:
view
plaincopy
toclipboardprint?
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
NSString *phone =
@"4006509988";
NSURL *url = [NSURL
URLWithString:[NSString
stringWithFormat:@"tel:%@", phone]];
//[[UIApplication sharedApplication] openURL:url];//普通方式
//拨打前有提示,拨打完后自动回到应用中
UIWebView *callPhoneWebVw = [[UIWebView
alloc] init];
NSURLRequest *request = [NSURLRequest
requestWithURL:url];
[callPhoneWebVw
loadRequest:request];
}
- (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"]];
}
openURL的使用方法:
view
plaincopy
toclipboardprint?
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:appString]];
其中系统的appString有:
view
plaincopy
toclipboardprint?
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
NSString *phone =
@"4006509988";
NSURL *url = [NSURL
URLWithString:[NSString
stringWithFormat:@"tel:%@", phone]];
//[[UIApplication sharedApplication] openURL:url];//普通方式
//拨打前有提示,拨打完后自动回到应用中
UIWebView *callPhoneWebVw = [[UIWebView
alloc] init];
NSURLRequest *request = [NSURLRequest
requestWithURL:url];
[callPhoneWebVw
loadRequest:request];
}
- (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调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等
- iPhone开发之调用系统地图、邮件、电话、短信、浏览器
- iphone调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等
- iphone调用系统电话、浏览器、地图、邮件等(转)
- iOS程序中调用系统自带应用(短信,邮件,浏览器,地图,appstore,拨打电话)
- iOS开发笔记--调用iPhone的短信、地图、电话、邮件、浏览器
- iOS程序中调用系统自带应用(短信,邮件,浏览器,地图,appstore,拨打电话)
- ios应用中调用系统电话、浏览器、地图、邮件等 以及打开其他应用(如qq,msn)
- iOS 程序中调用系统自带应用(短信,邮件,浏览器,地图,appstore,拨打电话)