- //设备相关信息的获取
- NSString *strName = [[UIDevice currentDevice] name];
- NSLog(@"设备名称:%@", strName);
- NSString *strId = [[UIDevice currentDevice] uniqueIdentifier];
- NSLog(@"设备唯一标识:%@", strId);
- NSString *strSysName = [[UIDevice currentDevice] systemName];
- NSLog(@"系统名称:%@", strSysName);
- NSString *strSysVersion = [[UIDevice currentDevice] systemVersion];
- NSLog(@"系统版本号:%@", strSysVersion);
- 判断手机系统是几的系统
-
if( ([[[UIDevice currentDevice] systemVersion] doubleValue]>=7.0)){
}
- NSString *strModel = [[UIDevice currentDevice] model];
- NSLog(@"设备模式:%@", strModel);
- NSString *strLocModel = [[UIDevice currentDevice] localizedModel];
- NSLog(@"本地设备模式:%@", strLocModel);
- float version = [[[UIDevice currentDevice] systemVersion] floatValue];
- NSLog(@"版本号:%f\n", version);
- //app应用相关信息的获取
- NSDictionary *dicInfo = [[NSBundle mainBundle] infoDictionary];
- // CFShow(dicInfo);
- NSString *strAppName = [dicInfo objectForKey:@"CFBundleDisplayName"];
- NSLog(@"App应用名称:%@", strAppName);
- NSString *strAppVersion = [dicInfo objectForKey:@"CFBundleShortVersionString"];
- NSLog(@"App应用版本:%@", strAppVersion);
- NSString *strAppBuild = [dicInfo objectForKey:@"CFBundleVersion"];
- NSLog(@"App应用Build版本:%@", strAppBuild);
1. 判断设备的类型ipad或者iphone,可在main中定义一个宏来记录。
#define IS_IPAD ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] &&[[UIDevice currentDevice] userInterfaceIdion] == UIUserInterfaceIdiomPad)
2. 调用自带应用
调用Email
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://email邮箱地址"]];
调用系统电话phone
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://88888888"]];
调用SMS
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms://888588"]];
调用自带浏览器Safari
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://网址"]];
还有:itms:// 可以打开MobileStore.app
audio-player-event:// 可以打开iPod
audio-player-event://?uicmd=show-purchased-playlist 可以打开iPod播放列表
video-player-event:// 可以打开iPod中的视频
3. 禁止锁屏
UIApplication *app = [UIApplication sharedApplication];
app.idleTimerDisabled = YES;
4. 设置icon上的数字
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
Fromhttp://blog.sina.com.cn/s/blog_a263f0c601010sr9.html