在iPhone SDK里有个UIDevice类,很多系统相关的参数都可以从这里取得。
下面是使用此类获取系统版本号的一段实例代码:
NSString *deviceStr = [[UIDevice currentDevice] systemVersion];
在iPhone里面,大家常见通过某链接直接调用Safari打开某个页面或者调用邮件发送程序发送邮件的应用,其实现其实非常简单:
NSString *recipients = @"mailto:xxx@gmail.com?subject=Feedback for x app";
NSString *body = @"&body=Try mail";
NSString *email = [NSString stringWithFormat:@"%@%@", recipients, body];
email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
或者:
NSString *email = @"";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
阅读(1102) | 评论(0) | 转发(0) |