怎样推断 ios设备的类型(iphone,ipod,ipad)
2024-09-30 01:53:45
-(bool)checkDevice:(NSString*)name
{
NSString* deviceType = [UIDevice currentDevice].model;
NSLog(@"deviceType = %@", deviceType); NSRange range = [deviceType rangeOfString:name];
return range.location != NSNotFound;
}
NSString * nsStrIphone=@"iPhone";
NSString * nsStrIpod=@"iPod";
NSString * nsStrIpad=@"iPad";
bool bIsiPhone=false;
bool bIsiPod=false;
bool bIsiPad=false;
bIsiPhone=[self checkDevice:nsStrIphone];
bIsiPod=[self checkDevice:nsStrIpod];
bIsiPad=[self checkDevice:nsStrIpad];
最新文章
- Python 学习第十九天 django知识
- Vue - 在v-repeat中使用计算属性
- eclipse启动不了
- 用CSS3实现背景的固定
- web.xml中同一servlet/filter配置多个url-pattern
- 解决oracle启动的错误: ORA-00119 ORA-00132
- cf C. Arithmetic Progression
- 【android】adb连接几个常见问题(遇到再新增)
- 执行testng appium用例失败,自动截图
- nginx配置文件详细解读
- Python 子进程不能input
- sklearn中的朴素贝叶斯模型及其应用
- GNU Screen Usage
- TensorFlow实战Google深度学习框架8-9章学习笔记
- python基础07_tuple_dict
- ubuntu14.04 cpu-ssd
- BZOJ 1283: 序列
- thinkphp 前台测试
- Xshell传输文件
- 关于用GetManifestResourceNames读不出资源文件的解决
热门文章
- javaScript 笔记(5) --- jQuery(上)
- 【09】react 之 表单组件
- Mysql和sqlServer命令比较
- BZOJ 4766: 文艺计算姬
- 洛谷P2668 斗地主 [NOIP2015]
- 为IIS添加json扩展类型文件的MiME类型
- c# dynamic,maybe I should say it is just some shortcut for ";Object";, box and unbox, without the cast
- visual studio 插件 resharper 使用指南
- 牛客网 牛客练习赛13 B.幸运数字Ⅱ-数组 or DFS
- (21)Oracle表查询进阶