-1

This might sound a newbie question, however I'm new to Mac OS,

Here I've got a compiled application with old Base SDK let say 10.5 version, and it is running without any problem on Mac OS 10.5 version.

On recent version of Mac OS 10.6, 10.7 it works incorrectly in some cases.

The old app should stay compatible in new version of OS, Basically I would like to know how Apple keeps the compatibility with the old applications inside new versions of Mac OS ?

deimus
  • 9,565
  • 12
  • 63
  • 107
  • It should run OK - it's probably one or more latent bugs in your code that are only showing up in the newer OS – Paul R Apr 25 '12 at 13:40
  • Can you please bring an example ? And how the mac handles the backward compatibility of the apps ? – deimus Apr 25 '12 at 13:42
  • Think about it - when you upgrade your OS to a newer version, do all your old apps suddenly stop working ? – Paul R Apr 25 '12 at 13:43
  • I know that they are not ! I'm interested in technical aspect of the question, i.e. how Apple handles backward compatiblity – deimus Apr 25 '12 at 13:47
  • 1
    Um, by not breaking it (usually). They just leave all of the existing functionality in the frameworks and make sure it continues to have the same semantics, even if they also add new functionality to the frameworks. In other words, you're not asking a clear question. – Ken Thomases Apr 25 '12 at 14:01
  • Guys I'm just very new to Mac OS world. Which part is not clear ? I just want to know how Apple handles its SDK changes over each updated of the OS. Let say in 10.6 version there is some API and is 10.7 the same API has some changes inside its implementation. So after update the library containing the implementation of the code will be replaced, or it will be copied to some backward compatibilty "stack" to support old applications and new version of the library will become active one. Please point me which part of my question is not clear, looking forward to correct it. – deimus Apr 25 '12 at 14:55
  • @KenThomases has my comment above made it more clear ? Anyway updated only the question itself. – deimus Apr 25 '12 at 15:01

1 Answers1

0

Apple is usually very careful to ensure backward compatibility of their APIs so that older apps don't break when you upgrade your OS. They don't delete APIS but just mark them as deprecated.

It's most likely that your application was doing something unsupported or had a bug in it that has been exposed as Apple has changed the implementation of its APIs.

Off the top of my head some possible causes

  • your app uses Apple private APIs that have changed.
  • your app passes some invalid parameter to an API whose implementation has changed (an example might be using an int where the API expects an NSInteger).
  • your app unwittingly exploited a bug that has now been resolved (e.g. garbage collection and NSOperationQueues existed in 10.5 but were very much beta).

Try recompiling your application using a current Xcode against the latest API, with the -Wall warning flag on and the static analyser enabled. This will tell you where you are using deprecated APIs, wrong assumptions about pargument and return types and a host of other issues.

JeremyP
  • 84,577
  • 15
  • 123
  • 161
  • OK, got it, thanks for details, that what I wanted to hear. One more question and I'm marking as an answer.When you say compile against latest API, you mean to set the latest available base SDK ? in that case I'll get lots of depreciated warnings. Shan't I compile with the base 10.5 SDK and fix the problems on each Mac OS X separately ? – deimus Apr 25 '12 at 14:48
  • 1
    @deimus: Sorry, yes, the latest base SDK which will be 10.7. This was only so that you *do* get all the deprecation warnings. If you want to deal with them separately, use the latest base SDK but with a deployment target of 10.5, or compile against the 10.5 SDK – JeremyP Apr 25 '12 at 15:20