下面是使用此类获取系统版本号的一段实例代码:
NSString *deviceStr = [[UIDevice currentDevice] systemVersion];
在iPhone里面,大家常见通过某链接直接调用Safari打开某个页面或者调用邮件发送程序发送邮件的应用,其实现其实非常简单:
NSString *recipients = @"mailto:[email protected]?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 = @"http://www.google.cn";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];