首页 > 捕捉iphone ipod设备型号

捕捉iphone ipod设备型号

如何在程序中获知iphone 和 ipod的设备型号,因为5的屏幕比较大,我需要在布局上做一些处理,谢谢


虽然不懂ios,不过我google还是耍得很利害的 呵呵

Complete List of iOS User-Agent Strin...
Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A405 Safari/8536.25

Apple-iPhone5C1/1001.405 iPhone 5 GSM 6.0 10A405 Sept 19, 2012

以下代码是提取user-agent的
来自stackoverflow

UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectZero]; 
NSString *uaString = [webView stringByEvaluatingJavaScriptFromString:"@navigator.userAgent"];

[[UIDevice currentDevice] model];

https://github.com/erica/uidevice-ext...

其中UIDevice-Hardware这个Category就能解决你的问题。

【热门文章】
【热门文章】