1.打電話
UIApplication *app = [UIApplication sharedApplication];
[app openURL:[?NSURL URLWithString:@"tel://10086"]];
2.發(fā)短信
[app openURL:[NSURL URLWithString:@"sms://10086"]];
3.發(fā)郵件
[app openURL:[NSURL URLWithString:@"mailto://447640819@qq.com"]];
4.打開(kāi)一個(gè)網(wǎng)頁(yè)資源
[app openURL:[NSURL URLWithString:@"http://m.baidu.com"]];
5.可以通過(guò)設(shè)置UIApplication的idleTimerDisabled屬性來(lái)指定iOS是否鎖頻:
// 禁用休閑時(shí)鐘
[[UIApplication sharedApplication] setIdleTimerDisabled: YES];
[UIApplication sharedApplication].idleTimerDisabled = YES;