//我们应用中也是常常会用到这些应用,这里说一些常用且好理解的方法!
#import "NewViewController.h"
#import <MessageUI/MessageUI.h>
@interface NewViewController ()<MFMailComposeViewControllerDelegate,MFMessageComposeViewControllerDelegate>//邮件代理 短信代理 这两个主要是用户操作回调
@end
@implementation NewViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSArray *arr = @[@"电话",@"短信",@"邮件"];
for(int i = 0;i<6;i++)
{
UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
btn.frame = CGRectMake(10+i%3*100, 80+i/3*150, 100, 60);
[btn setTitle:arr[i%3] forState:UIControlStateNormal];
[self.view addSubview:btn];
btn.tag = 1000+i;
[btn addTarget:self action:@selector(btnDown:) forControlEvents:UIControlEventTouchUpInside];
}
UILabel *lab = [[UILabel alloc] initWithFrame:CGRectMake(0, 150, 320, 40)];
lab.text = @"我上面是直接跳转打开,下面更加高级一点的支持预定义";
[self.view addSubview:lab];
}
-(void)btnDown:(