I'm searching for a way to detect the device my app is running on. I am not interested in software version. I searched many questions but none of them (surprisingly) satisfy my needs for following reasons:
Solution 1:
NSString *deviceType = [UIDevice currentDevice].model;
This does not work because it gives me just "iPad". I want to know whether it is iPad, iPad 2, new iPad, iPhone 3GS, iPhone4 etc.
Solution 2: Not testing for device type, checking for individual capabilities
This does not apply because I want this data to collect user statistics, not to perform any device specific operation.
Solution 3: Using UIDeviceHardware found here
This code looks pretty outdated and seems to access private data on the device. There is even debate whether an app using this will get approved or not. More importantly, I have no idea how it works :) An alternative is also found here
Are any of the last two I mentioned safe to use? Are they future compliant? Do they comply with Apple approval rules?
Or is there any other method to get around this?
Thanks in advance.