简要咨询咨询QQ网站导航网站搜索手机站点联系我们设为首页加入收藏 

调用iphone地图、电话、邮件、短信及内容方法

来源:易贤网   阅读:2189 次  日期:2014-11-04 11:42:46

温馨提示:易贤网小编为您整理了“调用iphone地图、电话、邮件、短信及内容方法”,方便广大网友查阅!

代码如下:

-(IBAction)openMaps {

// Where is Apple on the map anyway?

NSString* addressText = @"1 Infinite Loop, Cupertino, CA 95014";

// URL encode the spaces

addressText = [addressText stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding];

NSString* urlText = [NSString stringWithFormat:@"@", addressText];

// lets throw this text on the log so we can view the url in the event we have an issue

NSLog(urlText);

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlText]];

}

-(IBAction)openEmail {

// Fire off an email to apple support

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

}

-(IBAction)openPhone {

// Call Google 411

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

}

-(IBAction)openSms {

// Text to Google SMS

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

}

-(IBAction)openBrowser {

// Lanuch any iPhone developers fav site

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

}

//自动填写短信内容

代码如下:

MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];

picker.messageComposeDelegate = self;

picker.recipients = [NSArray arrayWithObject:@"48151623"];

picker.body = @"Body text.";

[self presentModalViewController:picker animated:YES];

[picker release];

更多信息请查看IT技术专栏

更多信息请查看技术文章
点此处就本文及相关问题在本站进行非正式的简要咨询(便捷快速)】     【点此处查询各地各类考试咨询QQ号码及交流群
上一篇:ios中摄像头/相册获取图片,压缩图片,上传服务器方法总结
下一篇:CoCoa编程中视图控制器与视图类介绍
易贤网手机网站地址:调用iphone地图、电话、邮件、短信及内容方法
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!