0

Is there a way to make sure that an app will run on osx 10.5 when compiling from osx 10.7 (xcode 4.4)?

Or at least, that it has successfully compiled for 10.5?

Daniel
  • 20,420
  • 10
  • 92
  • 149

1 Answers1

0

You should set the deployment target to OS X 10.5. Ensure that you don't use any API that wasn't available on 10.5 (or, if you do, that you use it weakly and have a fallback code path that will be used if the APIs aren't available). Test your application on 10.5.

Options for fallback coding:

  • test whether an API object responds to a selector introduced since 10.5
  • test whether a class introduced since 10.5 exists by getting a reference through NSClassFromString()
  • weak-link against SDK frameworks, discover at runtime whether symbols from these frameworks are NULL
  • dynamically load shared libraries with dlopen(), falling back if they don't exist
  • I do everything you have said, but somehow it does not seem to compile right for 10.5. Aren't there any logs from the Xcode compiler? It does not throw any errors... – Daniel Jul 30 '12 at 11:27
  • PS: I have no mac with OSX 10.5 – Daniel Jul 30 '12 at 11:27
  • @simpleBob How do you know it doesn't compile right for 10.5 if there are no compiler errors and you didn't test on 10.5? Xcode 4 does not compile for PowerPC. To access build logs open the log navigator by choosing View > Navigators > Show Log Navigator. Select the build from the log navigator to open the build results editor. Select a build step from the editor. A small button with horizontal lines should appear. Click the button to see the build transcript. – Swift Dev Journal Jul 30 '12 at 18:16
  • I get this error if i set the deployment target to OSX 10.5 on Xcode 4.4: http://stackoverflow.com/questions/11728634/xcode-4-4-osx-10-5-as-development-target-clang-llvm-1-0-error – Oneiros Jul 30 '12 at 19:56
  • @MarkSzymczyk A friend of mine has a 10.5 and he testet it for me. But he cannot be bothered testing it all the time, and I do not want to buy a mac for each os and each architecture I develop on. (I do not develop for ppc) – Daniel Jul 31 '12 at 09:15
  • @Oneiros I do not get that error, but then again, I do not use ARC – Daniel Jul 31 '12 at 09:17
  • I get: `Symbol not found: __NSConcreteGlobalBlock Referenced from: /Volumes/XXX/XXX/Contents/MacOS/../Frameworks/Sparkle.framework/Versions/A/Sparkle Expected in: /usr/lib/libSystem.B.dylib` which means that blocks are used somewhere.. but I can't find where, probably a library referenced from sparkle.. – Daniel Jul 31 '12 at 09:18
  • @simpleBob If you're not supporting PowerPC and don't want to buy a Mac to test on 10.5, dropping 10.5 support would save you a lot of hassle. The main reason to support 10.5 and earlier is for PowerPC support. Most people with Intel Macs run 10.6 or newer. – Swift Dev Journal Jul 31 '12 at 19:26