Quote:
Originally Posted by ethanwa
Detect which iOS version is running? HOW?
Can someone tell me how? I know how to detect the device, now I need to detect the iOS version.
Thanks.
|
Code:
[textView.text = [[UIDevice currentDevice] systemVersion];
if ([textView.text isEqualToString:@"2.0"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"iOS 2.0"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
if ([textView.text isEqualToString:@"3.0"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"iOS 3.0"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
if ([textView.text isEqualToString:@"4.0"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"iOS 4.0"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
....and just hide the textView.