zoukankan      html  css  js  c++  java
  • 在 iOS 中如何发短信

    从 iOS MFMessageComposeViewController,可以用来发短信。

    用法:

    MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
    picker.messageComposeDelegate = self;
    picker.recipients = [NSArray arrayWithObjects:@"1234", @"2345", nil];
    picker.body = yourTextField.text
    
    [self presentModalViewController:picker animated:YES];
    [picker release];

    Obviously, you need to first import the MessageUI.framework: Right click on the name of your app in "Groups & Files" and choose Add > Existing Frameworks....

    Import it into your classes via #import <MessageUI/MessageUI.h> and add<MFMessageComposeViewControllerDelegate> in the .h file, e.g. like so:

    #import <UIKit/UIKit.h>
    #import <MessageUI/MessageUI.h>
    
    @interface YourClass : UIViewController <MFMessageComposeViewControllerDelegate> 
    {
        // ...

  • 相关阅读:
    什么是https?
    Gojs
    GoJs 01讲解
    你真的了解WebSocket吗?
    django channels
    序列化及反序列化
    全角转半角
    Thread Culture
    设置输入法
    token的认证使用
  • 原文地址:https://www.cnblogs.com/Proteas/p/2943916.html
Copyright © 2011-2022 走看看