1、从程序内 发送短信
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:// "]];
短信的内容无法初始化,至少在3.2之前是这样,但是可以通过将要初始化的信息写到拷贝里来弥补。
2、从程序内 发送邮件
-(void) checkSender:(id) sender{

Class mailClass = (NSClassFromString(@”MFMailComposeViewController”));

if (mailClass != nil) {

if ([mailClass canSendMail]){

[self displayComposerSheet];

}else{

[self launchMailAppOnDevice];

}

} else{

[self launchMailAppOnDevice];

}

}

 

#pragma mark -

#pragma mark Compose Mail

 

// Displays an email composition interface inside the application. Populates all the Mail fields.

-(void)displayComposerSheet

{

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

picker.mailComposeDelegate = self;

[picker setSubject:@"subject"];

// Fill out the email body text

NSString *emailBody = @”email body”;

[picker setMessageBody:emailBody isHTML:NO];

[self presentModalViewController:picker animated:YES];

[picker release];

}

 

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error

{

[self dismissModalViewControllerAnimated:YES];

}

 

3、从程序里 打开safari

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://tr4work.blog.163.com/"]];


4、从程序里 打开电话功能
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://1000000"]];

5、制作一个黏贴,拷贝
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];

pasteboard.string =@”初始化信息”;

相关文章:

  • 2021-11-27
  • 2021-12-31
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2021-07-13
猜你喜欢
  • 2021-07-11
  • 2022-12-23
  • 2021-12-26
  • 2021-12-20
  • 2021-04-20
  • 2022-12-23
相关资源
相似解决方案