查找iPhone型号信息 [英] Find iPhone Model information
本文介绍了查找iPhone型号信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
虽然在您的应用程序中找到并使用此信息并不是一个好习惯,但有没有办法找到您拥有的iPhone / iPod / iPad型号。例如:2G / 3GS / 4G等
While it's not good practise to find out and use this information in your application, is there a way to find what model of iPhone / iPod / iPad you have. For example: 2G/3GS/4G etc
推荐答案
尝试:
char deviceString[256];
size_t size = 255;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
if (size > 255) { size = 255; }
sysctlbyname("hw.machine", deviceString, &size, NULL, 0);
if (strcmp(deviceString,"iPhone1,1") == 0) { etc... } // 2G
1,2是3G,
2,1是3GS,
3,1是i4等。
1,2 is a 3G, 2,1 is a 3GS, 3,1 is an i4, etc.
这篇关于查找iPhone型号信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文