Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-22-2010, 05:32 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Seattle, WA USA
Posts: 577
Default Detect which iOS version is running? HOW?

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.
ethanwa is offline   Reply With Quote
Old 07-22-2010, 05:45 PM   #2 (permalink)
Hot Cocoa Touch
 
redon's Avatar
 
Join Date: Oct 2009
Location: Florida
Posts: 193
Default

Quote:
Originally Posted by ethanwa View Post
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.
__________________
http://www.bugspray.me/
Search GetFit! on the App Store.

Last edited by redon; 07-22-2010 at 06:00 PM.
redon is offline   Reply With Quote
Old 07-22-2010, 05:46 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Seattle, WA USA
Posts: 577
Default

Thank you.
ethanwa is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,557
Threads: 89,123
Posts: 380,243
Top Poster: BrianSlick (7,102)
Welcome to our newest member, wTaylorDaviesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:52 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0