PDA

View Full Version : Support older OS's?




ArtOfWarfare
Feb 25, 2012, 12:49 PM
I've received an email from a customer who asked why my app is Lion only.

Honestly, the answer is, I have no idea. I don't think my app relies on anything in Lion that wasn't in Snow Leopard.

So my question is, what do I need to change to make it so my app will run on Snow Leopard?

I assume there are a few fields in my Xcode project I need to change... and maybe some on iTunes Connect, as well?

Also, any suggestions on how I can test my app on Snow Leopard before releasing it? (Or should I not really worry about that?)



thundersteele
Feb 25, 2012, 12:56 PM
Xcode 4.2/4.3 builds for Lion only by default. You can change this in the build settings.

Unfortunately I'm not sure how exactly to achieve this. One option is to change the "deployment target" on the summary page of the project to an earlier version. This might do the trick.

Otherwise you can change back to use the 10.6 SDK, but I don't think this is the right thing to do.

You should definitely find someone who can test the app on SL.

Blakeasd
Feb 25, 2012, 05:02 PM
Before you build for Snow Leopard, I would suggest checking to make sure the frameworks you used can be built for Snow Leopard as well as Lion.

gnasher729
Feb 25, 2012, 05:25 PM
I've received an email from a customer who asked why my app is Lion only.

Honestly, the answer is, I have no idea. I don't think my app relies on anything in Lion that wasn't in Snow Leopard.

So my question is, what do I need to change to make it so my app will run on Snow Leopard?

I assume there are a few fields in my Xcode project I need to change... and maybe some on iTunes Connect, as well?

Also, any suggestions on how I can test my app on Snow Leopard before releasing it? (Or should I not really worry about that?)

You should never release any software that you haven't tested. If your Mac was originally sold with 10.6, then you should be able to install 10.6 again on a separate partition or on an external drive. If your Mac shipped with Lion, tough.

To run on 10.6, you need to change the "deployment target" in XCode to 10.6. This allows the app to run on 10.6. Now there are two possibilities: Your app either doesn't use any 10.7 features, or it does.

If you don't use 10.7 features, then you just build with the 10.6 SDK. If you use 10.7 features, then obviously you need to avoid using them when running on 10.6, or your app will just crash. Now we are talking about serious work and need for seriously careful programming and testing. Tell us if you want to go down that road.

rossipoo
Feb 26, 2012, 01:33 AM
Wirelessly posted (Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3)

You don't need to change libraries, in fact I would recommend using the latest available. If you set your deployment target to the minimum version you want to support, then the compiler will ensure that it will work for that platform. If you use a feature that is not available, an error will occur for offending lines of code.

gnasher729
Feb 26, 2012, 02:32 AM
Wirelessly posted (Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3)

You don't need to change libraries, in fact I would recommend using the latest available. If you set your deployment target to the minimum version you want to support, then the compiler will ensure that it will work for that platform. If you use a feature that is not available, an error will occur for offending lines of code.

Nonsense. Total nonsense. If you don't change the SDK, the app will start happily on 10.6 and crash when the first 10.7 function is called, without any warning by the compiler.

thundersteele
Feb 26, 2012, 11:43 AM
Here's a guide:

https://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html

Has everything one might need to know about building for different OSX versions.

PatrickCocoa
Feb 26, 2012, 04:09 PM
SLOW DOWN! or better yet, STOP.

This is a huge decision that will have major ramifications for your development cycle for years and years. Think very carefully before you support older OS version.

Most of the advice you've received is about technical aspects of how to do this. But the major issues are not technical, they're business. What is the benefit to supporting the older system and what is the cost?

The benefit is (presumably) more sales. How many more sales? Let's say $X. You can come up with your own estimate of $X.

The cost is the extra time and money you spend. You will absolutely need a hardware setup with the older OS for testing.

There are many other considerations - you have taken the first step on a road to Troubleville. Since you asked my advice, reply either:

a) we support only Lion, thanks for your inquiry.

b) we support only Lion as we want to focus our development energy on making the best software to help you do whatever it is you do, thanks for your inquiry.

Member(TM)
Mar 6, 2012, 07:52 AM
I would still recommend to support Snow Leopard for releases in the short term, unless you cannot afford the cost of working to revise possible Lion-only code and having a Snow Leopard test system.

From time to time I check my web server logs, and in February downloads of my programs from Snow Leopard still made about 32%, which is not negligible. That means 32% users that would have looked elsewhere if I had stopped supporting Snow Leopard, and even when most will eventually upgrade to Lion they might choose not to return to my program if they have found something else that does the job.

For releases in the long term, it's obvious that the Snow Leopard user base can only shrink, so in that case it's true that it may make little business sense to care about supporting it.

EricBlue
Mar 8, 2012, 03:44 PM
Iīm also in favor of supporting Snow Leopard. In my view far superior to the sluggish Lion.

As people says, it has also a large market share. Even bigger then Lion! (http://insights.chitika.com/2011/mac-os-x-lion-fails-to-roar/)

robvas
Mar 8, 2012, 05:34 PM
Iīm also in favor of supporting Snow Leopard. In my view far superior to the sluggish Lion.

As people says, it has also a large market share. Even bigger then Lion! (http://insights.chitika.com/2011/mac-os-x-lion-fails-to-roar/)

I wonder if Leopard still has 22%. Didn't think that many people were still on it.

thundersteele
Mar 8, 2012, 06:09 PM
I wonder if Leopard still has 22%. Didn't think that many people were still on it.

The validity of the above report has been disputed elsewhere:
http://www.appleinsider.com/articles/11/11/11/web_stats_indicate_mac_os_x_lion_still_growing_very_fast.html

I don't know if that report is more accurate, but I find it more plausible. Mac sales are going up, and all new Macs come with Lion, so a stagnant share would be very surprising. The link reports 30% in november 2011, and if you follow another link to netmarketshare.com they claim it's close to 40% now.

Anyways, if you go where the market share is, then the program should be ported to windows... 92% !!!

robvas
Mar 8, 2012, 07:01 PM
The validity of the above report has been disputed elsewhere:
http://www.appleinsider.com/articles/11/11/11/web_stats_indicate_mac_os_x_lion_still_growing_very_fast.html

I don't know if that report is more accurate, but I find it more plausible. Mac sales are going up, and all new Macs come with Lion, so a stagnant share would be very surprising. The link reports 30% in november 2011, and if you follow another link to netmarketshare.com they claim it's close to 40% now.

Anyways, if you go where the market share is, then the program should be ported to windows... 92% !!!
XP is still alive and kicking somehow after what, 10 years? The speed at which Apple releases and obsoletes an OS version is both good and bad I guess.

Aug 2009 to Spring 2012 isn't a bad run for Snow Leopard I guess.

EricBlue
Mar 10, 2012, 06:21 AM
The validity of the above report has been disputed elsewhere:
http://www.appleinsider.com/articles/11/11/11/web_stats_indicate_mac_os_x_lion_still_growing_very_fast.html

I don't know if that report is more accurate, but I find it more plausible. Mac sales are going up, and all new Macs come with Lion, so a stagnant share would be very surprising. The link reports 30% in november 2011, and if you follow another link to netmarketshare.com they claim it's close to 40% now.

Anyways, if you go where the market share is, then the program should be ported to windows... 92% !!!

I donīt claim Lion is not growing. Itīs quite obvious as you canīt buy snow leopard anymore.

But I believe that Snow Leopard is still a big player and will be for some time. So its unfortunate to ignore all SL users.

If you look at the latest serverstats from Wikimedia (http://stats.wikimedia.org/wikimedia/squids/SquidReportOperatingSystems.htm) (with wikipedia.org hitstats), you see that the user share for february is:

Snow leopard 50.4 %
Lion 32.7 %
leopard 16.9 %

Itīs also not hard to make an app run on both Snow Leopard and Lion, as the differences on the SDK, is quite negligible.

ArtOfWarfare
Mar 10, 2012, 08:01 AM
I found a relative's old computer running snow leopard and was able to test on it.

All I had to do to make it work was change the OS version I was building for. I had to leave the base SDK the same... Seemed odd to me but it worked.

The only issue I found was that some of the text I'd laid out in a XIB didn't fit in the space on snow leopard. Namely, I have a text button with a drop down menu that was perfectly sized so that on lion all the text fits in the button regardless of option chosen. Under snow leopard though, the button is more bubbly so the text has a greater inset and the text gets truncated. Any suggestions on how to handle both lion's cleaner UI elements and snow leopard's more bubbly ones?

gnasher729
Mar 10, 2012, 08:26 AM
I found a relative's old computer running snow leopard and was able to test on it.

All I had to do to make it work was change the OS version I was building for. I had to leave the base SDK the same... Seemed odd to me but it worked.

The only issue I found was that some of the text I'd laid out in a XIB didn't fit in the space on snow leopard. Namely, I have a text button with a drop down menu that was perfectly sized so that on lion all the text fits in the button regardless of option chosen. Under snow leopard though, the button is more bubbly so the text has a greater inset and the text gets truncated. Any suggestions on how to handle both lion's cleaner UI elements and snow leopard's more bubbly ones?

You should at the very least compile with the 10.6 SDK. If there is any code that doesn't compile with the 10.6 SDK, that code would crash if it is executed on 10.6.

EricBlue
Mar 10, 2012, 11:07 AM
You should at the very least compile with the 10.6 SDK. If there is any code that doesn't compile with the 10.6 SDK, that code would crash if it is executed on 10.6.

If you compile with 10.6 sdk, and find calls thats 10.7 only, you need to take care of those calls. And then there is no problem building with 10.7 SDK.

----------

You should at the very least compile with the 10.6 SDK. If there is any code that doesn't compile with the 10.6 SDK, that code would crash if it is executed on 10.6.

I found a relative's old computer running snow leopard and was able to test on it.

All I had to do to make it work was change the OS version I was building for. I had to leave the base SDK the same... Seemed odd to me but it worked.

The only issue I found was that some of the text I'd laid out in a XIB didn't fit in the space on snow leopard. Namely, I have a text button with a drop down menu that was perfectly sized so that on lion all the text fits in the button regardless of option chosen. Under snow leopard though, the button is more bubbly so the text has a greater inset and the text gets truncated. Any suggestions on how to handle both lion's cleaner UI elements and snow leopard's more bubbly ones?

I sometimes, use one xib for Snow Leopard and one xib for Lion.

ArtOfWarfare
Mar 10, 2012, 12:29 PM
I sometimes, use one xib for Snow Leopard and one xib for Lion.

How could I make a snow leopard XIB on a machine running lion?

EricBlue
Mar 10, 2012, 01:04 PM
How could I make a snow leopard XIB on a machine running lion?

It's a regular XIB, but you layout it for Snow leopard. And also leave out elements thats Lion only (if you have any). Then in code, you check for the osx version and load the appropriate xib. An example:

SInt32 MacVersion;

if( Gestalt( gestaltSystemVersion, &MacVersion ) == noErr )
{
if( MacVersion < 0x1070 ) /* Older then Lion */
{
self = [super initWithWindowNibName:@"WindowSnowLeopard"];

}
else
{
self = [super initWithWindowNibName:@"WindowLion"];
}
}

ArtOfWarfare
Mar 10, 2012, 01:38 PM
It's a regular XIB, but you layout it for Snow leopard. And also leave out elements thats Lion only (if you have any). Then in code, you check for the osx version and load the appropriate xib. An example:

SInt32 MacVersion;

if( Gestalt( gestaltSystemVersion, &MacVersion ) == noErr )
{
if( MacVersion < 0x1070 ) /* Older then Lion */
{
self = [super initWithWindowNibName:@"WindowSnowLeopard"];

}
else
{
self = [super initWithWindowNibName:@"WindowLion"];
}
}
I think you misunderstood my question.

I meant to ask: how one can use the snow leopard version of UI elements in the interface builder portion of Xcode on a machine running Lion?

EricBlue
Mar 10, 2012, 03:24 PM
I think you misunderstood my question.

I meant to ask: how one can use the snow leopard version of UI elements in the interface builder portion of Xcode on a machine running Lion?

Is it a NSPopupButton that is the problem?

ArtOfWarfare
Mar 10, 2012, 04:07 PM
Is it a NSPopupButton that is the problem?

Yes, I think so. The arrows on the right side of the button take up much more space under snow leopard than lion, so much so that the last few letters of a word are cut off under snow leopard.

EricBlue
Mar 11, 2012, 06:59 AM
Yes, I think so. The arrows on the right side of the button take up much more space under snow leopard than lion, so much so that the last few letters of a word are cut off under snow leopard.

Hmm. Could one solution be that you make a Xib that you use for SL, and in that xib make the nspopupbutton larger in interface builder? And in that way make the text fit the button.

ArtOfWarfare
Mar 11, 2012, 11:47 AM
Hmm. Could one solution be that you make a Xib that you use for SL, and in that xib make the nspopupbutton larger in interface builder? And in that way make the text fit the button.

Yes, ultimately that's what needs to be done.

You keep missing what my question actually is.

I do not have a development computer running Snow Leopard. How can I create an interface using Snow Leopard UI elements (the more bubbly, aqua elements,) that were replaced in Lion, on a machine running Lion? Is it possible?

robvas
Mar 11, 2012, 12:41 PM
Yes, ultimately that's what needs to be done.

You keep missing what my question actually is.

I do not have a development computer running Snow Leopard. How can I create an interface using Snow Leopard UI elements (the more bubbly, aqua elements,) that were replaced in Lion, on a machine running Lion? Is it possible?

Virtual machine running Snow Leopards

ArtOfWarfare
Mar 11, 2012, 01:25 PM
Virtual machine running Snow Leopards

Thank you for that answer.

I was hoping for something less involved, but I guess that's the only option, then.

EricBlue
Mar 12, 2012, 03:49 AM
Yes, ultimately that's what needs to be done.

You keep missing what my question actually is.

I do not have a development computer running Snow Leopard. How can I create an interface using Snow Leopard UI elements (the more bubbly, aqua elements,) that were replaced in Lion, on a machine running Lion? Is it possible?

I think you donīt need to do anything. Its the same elements, just that Snow Leopard draws them differently. I think that the NSPopupButton is almost exactly the same since OS X 10.4 (tiger) at least.

The only difference is a new bezel style constant in Lion for the ButtonCell: NSInlineBezelStyle, and youīre probably dont use that one. Otherwise you can just choose any other and it will be fine. They all work in all OS Xs since tiger.