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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 01-19-2012, 01:00 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 4
WeaselPig is on a distinguished road
Default How do you check what version IOS a user has?

I'm about to release an app that uses ARC so it only works properly on phones with IOS 5. I know that I can state in the description it requires IOS 5 but what happens if someone with IOS 4.3 or lower tries to download it?

Does apple check to see if the user has IOS 5 installed? If not I am thinking of checking when the app is launched and if they do not have it installed the a message pops up explaining that they need IOS 5.

Has anyone else done anything similiar?
WeaselPig is offline   Reply With Quote
Old 01-19-2012, 01:22 PM   #2 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 45
Jakexx360 is on a distinguished road
Default

Quote:
Originally Posted by WeaselPig View Post
I'm about to release an app that uses ARC so it only works properly on phones with IOS 5. I know that I can state in the description it requires IOS 5 but what happens if someone with IOS 4.3 or lower tries to download it?

Does apple check to see if the user has IOS 5 installed? If not I am thinking of checking when the app is launched and if they do not have it installed the a message pops up explaining that they need IOS 5.

Has anyone else done anything similiar?
I assume it would be in the SDK for UIDevice currentDevice or something similar. If I were you that's where I'd look.
Jakexx360 is offline   Reply With Quote
Old 01-19-2012, 02:34 PM   #3 (permalink)
Registered Member
 
Join Date: Oct 2011
Age: 25
Posts: 169
mer10 is on a distinguished road
Default

Quote:
Originally Posted by WeaselPig View Post
I'm about to release an app that uses ARC so it only works properly on phones with IOS 5. I know that I can state in the description it requires IOS 5 but what happens if someone with IOS 4.3 or lower tries to download it?

Does apple check to see if the user has IOS 5 installed? If not I am thinking of checking when the app is launched and if they do not have it installed the a message pops up explaining that they need IOS 5.

Has anyone else done anything similiar?
Set the project and target iOS Deployment Target to 5.0. They won't be able to download your app unless they have iOS 5.0 or higher if you do this.
mer10 is offline   Reply With Quote
Old 01-19-2012, 02:52 PM   #4 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 245
samurle is on a distinguished road
Default

Quote:
Originally Posted by WeaselPig View Post
I'm about to release an app that uses ARC so it only works properly on phones with IOS 5. I know that I can state in the description it requires IOS 5 but what happens if someone with IOS 4.3 or lower tries to download it?

Does apple check to see if the user has IOS 5 installed? If not I am thinking of checking when the app is launched and if they do not have it installed the a message pops up explaining that they need IOS 5.

Has anyone else done anything similiar?
That's the great thing about the appStore. You don't have to check for these things. No need to check for
iOS version, and no need to check for iOS device model type either.

I don't recommend using any code checks like above. I think that's only useful if you're trying to make
a program backwards compatible. If not, just focus on running your program as it is.
samurle is offline   Reply With Quote
Old 01-19-2012, 05:30 PM   #5 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 4
WeaselPig is on a distinguished road
Default

Quote:
Originally Posted by mer10 View Post
Set the project and target iOS Deployment Target to 5.0. They won't be able to download your app unless they have iOS 5.0 or higher if you do this.
Thanks, I was hoping that would be the answer. Do you know if there is anywhere reliable to find stats on what percentage of devices are running the various IOS?
WeaselPig is offline   Reply With Quote
Old 01-19-2012, 07:46 PM   #6 (permalink)
Learner
 
Hyde's Avatar
 
Join Date: Jan 2012
Posts: 28
Hyde is on a distinguished road
Default

Quote:
Originally Posted by samurle View Post
That's the great thing about the appStore. You don't have to check for these things. No need to check for
iOS version, and no need to check for iOS device model type either.

I don't recommend using any code checks like above. I think that's only useful if you're trying to make
a program backwards compatible. If not, just focus on running your program as it is.
That's really useful to know. I was worrying about this but your answer was very helpful.
Hyde is offline   Reply With Quote
Old 01-20-2012, 02:24 AM   #7 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 245
samurle is on a distinguished road
Default

Quote:
Originally Posted by Hyde View Post
That's really useful to know. I was worrying about this but your answer was very helpful.
Well, if you expect your app will be installed on a jailbroken device, then you can do whatever
you want to keep your app from crashing. They don't play by the same rules.
samurle is offline   Reply With Quote
Old 01-20-2012, 05:01 AM   #8 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 13
c.cam108 is on a distinguished road
Default

Quote:
Originally Posted by WeaselPig View Post
I'm about to release an app that uses ARC so it only works properly on phones with IOS 5. I know that I can state in the description it requires IOS 5 but what happens if someone with IOS 4.3 or lower tries to download it?

Does apple check to see if the user has IOS 5 installed? If not I am thinking of checking when the app is launched and if they do not have it installed the a message pops up explaining that they need IOS 5.

Has anyone else done anything similiar?
Just a quick note that ARC is a compile-time feature, not run-time, so apps that use ARC will work under iOS4.

I'm bringing out an app using ARC that still works in 4.3. Just make sure you compile the app against the 5.0 SDK but set your deployment target to 4.3.

Colin C
c.cam108 is offline   Reply With Quote
Old 01-20-2012, 06:03 AM   #9 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 864
nobre84 is on a distinguished road
Default

ARC itself will work on iOS4, but not the "zeroing weak references", that automatically sets dead object pointers to nil.
nobre84 is offline   Reply With Quote
Old 01-20-2012, 06:23 AM   #10 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 13
c.cam108 is on a distinguished road
Default

Quote:
Originally Posted by nobre84 View Post
ARC itself will work on iOS4, but not the "zeroing weak references", that automatically sets dead object pointers to nil.
That's interesting. I quite often use if(!object) or if(object==nil) in my code and haven't seen a problem. Does that mean that the result of that is indeterminate?

I'm a bit confused by weak and strong references - do you know of any good material I can read to better understand them, especially with ARC in mind?

Colin C
c.cam108 is offline   Reply With Quote
Old 01-20-2012, 08:18 AM   #11 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 864
nobre84 is on a distinguished road
Default

Quote:
Originally Posted by c.cam108 View Post
That's interesting. I quite often use if(!object) or if(object==nil) in my code and haven't seen a problem. Does that mean that the result of that is indeterminate?

I'm a bit confused by weak and strong references - do you know of any good material I can read to better understand them, especially with ARC in mind?

Colin C
This is related only to weak properties / objects. Strong ones are our previous "retain", a property/object that will stick around as long as you use it. weak works more like a simple pointer or a "assign" property, having a pointer to it makes no effect on keeping it alive (thus the danger of later in execution, you try to access it and the pointed object no longer exists and crash)
On iOS5, ARC is able to nullify dead object pointers when they are released, on iOS 4 , not.
You should use weak/assign pointers to avoid retain cycles (a parent that has a strong/retain property to a child, and the child also needs a pointer to the parent -- delegates are the most common -- , so the delegate property MUST be weak/assign or else both objects will never be released)

So, you cant use the "weak" feature if you target iOS4, you should use the old "assign" type and housekeep yourself to make sure you never call a dead pointer, on viewDidUnload / dealloc, set all "assign" pointers to nil so they can't call you back after death.

More info on this: Beginning ARC in iOS 5 Tutorial Part 2 | Ray Wenderlich

Last edited by nobre84; 01-20-2012 at 08:21 AM.
nobre84 is offline   Reply With Quote
Reply

Bookmarks

Tags
app store, arc, ios 5

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
» Online Users: 402
9 members and 393 guests
7twenty7, Atatator, glenn_sayers, guusleijsten, iphonedevshani, QuantumDoja, Sami Gh, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,122
Posts: 402,907
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

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