hello everyone, I have one problem,i want to know the code threw which i can know about the i phone device,whether the device is old or new(as Hardware point of view). Please some one help me. Thanks in advance..
A:
I'm not sure I understand your question, but you might want to have a look at the UIDevice class. It has a property model
which returns a string like "iPhone" or "iPod Touch". You didn't say why you want to know whether a device is new or "old", but if it's about whether multitasking is supported, that's what the multitaskingSupported
property of UIDevice is about.
DarkDust
2010-08-31 07:28:29
A:
This code returns the device hardware name with numbers that go higher with newer hardware:
char machine[256];
size_t size = 255;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
if (size > 255) { size = 255; }
sysctlbyname("hw.machine", machine, &size, NULL, 0);
hotpaw2
2010-08-31 08:00:05