(一)判断程序是否为第一次运行:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // 放在didFinishLaunching里面执行 };
(二)判断字符串是否为中文字符串
(三)将字符串@"苹果中国"变成 @"苹***"
(四)[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@""]];
(1)调用系统打电话功能
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://10010"]];
//调用系统打电话功能,通话结束会停留在拨号界面;
NSURL *phoneURL = [NSURL URLWithString:@"tel://telephoneNumber"];
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
[webView loadRequest:[NSURLRequest requestWithURL:phoneURL]];
[self.view addSubview:webView];
//打电话弹出提示,回到应用
(2)调用系统发送邮件
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://dntalk@yeah.net"]];
//向dntalk@yeah.net发送邮件
(3)打开Safari
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.baidu.com"]];
//调用Safari打开网址