if([MFMessageComposeViewController canSendText]) {
MFMessageComposeViewController * controller = [[MFMessageComposeViewController alloc] init];
controller.recipients = @[weakSelf.detailModel.Telphone];//收信人
// controller.body = body;//短信内容
controller.messageComposeDelegate = weakSelf;
[weakSelf presentViewController:controller animated:YES completion:nil];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示信息"
message:@"该设备不支持短信功能"
delegate:nil
cancelButtonTitle:@"确定"
otherButtonTitles:nil, nil];
[alert show];
}
-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {
[self dismissViewControllerAnimated:YES completion:nil];
}

发送短信MFMessageComposeViewController的更多相关文章

  1. ios调用本地拨打电话,发送短信

    电话.短信是手机的基础功能,iOS中提供了接口,让我们调用.这篇文章简单的介绍一下iOS的打电话.发短信在程序中怎么调用. 1.打电话   [[UIApplication sharedApplicat ...

  2. iOS_拨打电话/发送短信

    GitHub address : https://github.com/mancongiOS/makeACallAndSendMessage.git 功能一: 拨打电话 1.可以有提示框.提示该电话号 ...

  3. IOS程序开发中-跳转到 发送短信界面 实现发短信

    前言:我发现我标题取的不好,谁帮我取个承接上下文的标题?评论一下,我改 项目需求:在程序开发中,我们需要在某个程序里面发送一些短信验证(不是接收短信验证,关于短信验证,传送门:http://www.c ...

  4. iOS发送短信

    iPhone开发,发送短信的方法: iPhone开发中,发送短信方法有二: 1.URL Scheme,这样不可以设置短信内容 1 2 3 [[UIApplication sharedApplicati ...

  5. IOS程序内发短信 MFMessageComposeViewController

    文章转载地址:http://www.headsky.org/?p=63 iOS4.0新加入了MFMessageComposeViewController和MFMessageComposeViewCon ...

  6. iOS+Swift: 使用MessageUI.framework发送短信

    在iOS中, 可以使用MessageUI.framework框架发送短信, 步骤如下: 代码下载http://git.oschina.net/yao_yu/swift_cnblogs_samples/ ...

  7. iOS摇一摇功能、震动功能、简单的摇动动画、生成二维码图片与发送短信等几个功能

    有一个开锁的功能,具体的需求就类似于微信的"摇一摇"功能:摇动手机,手机震动,手机上的锁的图片摇动一下,然后发送开锁指令.需求简单,但用到了许多方面的知识. 1.摇一摇 相对这是最 ...

  8. iOS中发送短信/发送邮件的实现 韩俊强的博客

    需要引入框架: MessageUI.framework 布局如下: 短信和邮件: #import "ViewController.h" #import <MessageUI/ ...

  9. iOS调用系统发送短信和邮件分享

    //发送邮件 -(void)sendMail:(NSString*)subject content:(NSString*)content{ MFMailComposeViewController*co ...

随机推荐

  1. js实现图片无缝连接

    效果图 1.首先先看看html和css代码 <style> *{padding:0;margin:0;} #div1{margin:100px auto;background:red;wi ...

  2. Java获取本机ip和服务器ip

    一.获取服务器IP InetAddress addr = InetAddress.getLocalHost().getHostAddress();//获得本机IP 二.获取客户端本机IP String ...

  3. php 判断文件或目录是否存在

    判断文件或目录是否存在有自带的函数 file_exists:文件是否存在 $file = "check.txt"; if(file_exists($file)) {     ech ...

  4. Xenko基础API笔记2-Enum Keys按键

    Name   Description A The 'a' key. Add The 'add' key. Apps The 'apps' key. Attn The 'attn' key. B The ...

  5. 正则表达式test验证的“bug”

    在使用正则表达式对某些字符串进行验证时,我们常常会使用到test方法,而该方法也隐藏着一个陷阱,今天就让我们来看一下这个问题. var str = 'hello jack, hello rose'; ...

  6. js 获取当前日期时间3种格式化方法 yyyy-mm-dd hh:MM:ss

    方法一: Date.prototype.format = function (format) { var args = { "M+": this.getMonth() + 1, & ...

  7. String类常用方法

    1.String类的特点,字符串一旦被初始化就不会被改变. 2.String对象定义的两种方式 ①String s = "affdf";这种定义方式是在字符串常量池中创建一个Str ...

  8. What's going on in background?

    Did you know that mobile phone manufacturer collect your info without notifying you? Did you know yo ...

  9. 查找jsp页面报错技巧

    在报错跳转页面打印错误信息<div>系统执行发生错误,信息描述如下:</div> <div>错误状态代码是:${pageContext.errorData.stat ...

  10. tp框架总结(二)

    一.函数库和类库 项目中的常用的函数库要封装到项目Common/function.php中  在项目中可以直接调用  [ 函数();] import方法是ThinkPHP内建的类库导入方法,提供了方便 ...