8
I need to distinguish iPhone 4S from iPhone 4. I went through the posts and got the following code. Please let me know if this is the only way of doing it and confirm that there is no problem by Apple if used.
struct utsname systemInfo;
uname(&systemInfo);
NSString *iPhoneVersion = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
For 4S, iPhoneVersion string will give me iPhone4,1 and iPhone 4 will say iPhone3,1.
Thanks for your suggestions.