I have an aesthetic UI element, a reflection, that works well on the iPhone 3Gs and iPod Touches, but is too slow on the 3G and prior. How best can I detect CPU speed so I can disable this function?
Instead of trying to detect speed, you could find out what model of iPhone or iPod Touch your application is running on, and then disable the function if it is not an accepted iPhone/iPod type.
To do this, you could add the following to your application:
#import <sys/utsname.h>
- (NSString *) machineModel {
struct utsname systemInfo;
uname (&systemInfo);
return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
}
Calling NSLog(@"Type: %@", [self machineModel])
will give you the hardware model.
See this post: http://www.iphonedevsdk.com/forum/iphone-sdk-development/4960-how-identify-device-user.html#post111621
I think that'll give you exactly what you are looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With