have Leopard functionality and still run on Tiger

  • Hey,

    I want my application to be able to run on Tiger and greater, but I
    also want it to have additional Leopard functionality when running on
    10.5. I have been able to execute certain functions with
    +respondsToSelector:, but new constants and such cannot be used. I
    tried changing the sdk to 10.5 and it did compile, but it won't run at
    all on 10.4. I'm sure there is a way to get this working, but I cannot
    find it in the documentation.

    Thanks,
    Mitchell Livingston
  • On 10/27/07, Mitchell Livingston <livings124...> wrote:
    > Hey,
    >
    > I want my application to be able to run on Tiger and greater, but I
    > also want it to have additional Leopard functionality when running on
    > 10.5. I have been able to execute certain functions with
    > +respondsToSelector:, but new constants and such cannot be used. I
    > tried changing the sdk to 10.5 and it did compile, but it won't run at
    > all on 10.4. I'm sure there is a way to get this working, but I cannot
    > find it in the documentation.

    The SDK setting defines the API set that will be available to your
    application. The deployment target defines the minimum version of the
    operating system the application should run on.

    <http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_de
    velopment/index.html?http://developer.apple.com/documentation/DeveloperTool
    s/Conceptual/cross_development/Introduction/chapter_1_section_1.html#//appl
    e_ref/doc/uid/10000163-BCICHGIE
    >

    -Shawn
  • I don't have a solution here but rather would also like to know the
    answer to this and other questions.

    I have an App that compiles and runs fine on 10.5 (Intel) with the
    10.5 SDK using XCode 3.0.

    When I install this App on a 10.4 PPC machine, it crashes in
    GetNextProcess().  I call this function to ensure multiple instances
    of my App are not loaded, but the reason for the crash is unclear, and
    it is not possible to debug a mix of 10.4/10.5 code on 10.4 creating a
    bit of a problem in supporting 10.4, or am I missing something?

    How can I debug my updated code on 10.4? XCode 2.5 with the 10.5 SDK?

    Also, what is the correct way to launch 10.4/10.5 mixed code on 10.4?
    I only have a few areas that need 10.5 functionality (namely updating
    the X509Anchors importing -> import to login keychain and set cert as
    trusted) and it works fine on 10.5 using Gestalt(), but won't load on
    10.4. The documentation is not very helpful on troubleshooting this.

    On Oct 27, 2007 2:34 PM, Mitchell Livingston <livings124...> wrote:
    > Hey,
    >
    > I want my application to be able to run on Tiger and greater, but I
    > also want it to have additional Leopard functionality when running on
    > 10.5. I have been able to execute certain functions with
    > +respondsToSelector:, but new constants and such cannot be used. I
    > tried changing the sdk to 10.5 and it did compile, but it won't run at
    > all on 10.4. I'm sure there is a way to get this working, but I cannot
    > find it in the documentation.
    >
    > Thanks,
    > Mitchell Livingston
    >
  • The only way to ensure that your code is working on both platforms is
    to first compile against the 10.4 SDK to outline the areas that are
    missing because you're using 10.5 functionality. Check the compiler
    warnings (and probably when you run it you can find some as well, I
    hope you have a good test suite). Armed with this information you can
    then test at runtime for the existence of linked-in functions/methods
    and re-create the missing constants from 10.5. After that you could
    compile against 10.5 again.
    But this is an error-prone way to do it. If your functionality is
    limited to something that can be loaded through a bundle, that is the
    preferred way to achieve this.
    All these things have been hashed out in previous versions of OS X
    (check the archives) and the Xcode documentation regarding this area
    is definitely something you need to take a look at.

    Cheers,
    Annard

    On 19 Nov 2007, at 23:17, Patrick M wrote:
    >
    > Also, what is the correct way to launch 10.4/10.5 mixed code on 10.4?
    > I only have a few areas that need 10.5 functionality (namely updating
    > the X509Anchors importing -> import to login keychain and set cert as
    > trusted) and it works fine on 10.5 using Gestalt(), but won't load on
    > 10.4. The documentation is not very helpful on troubleshooting this.
    >
    > On Oct 27, 2007 2:34 PM, Mitchell Livingston <livings124...>
    > wrote:
    >> Hey,
    >>
    >> I want my application to be able to run on Tiger and greater, but I
    >> also want it to have additional Leopard functionality when running on
    >> 10.5. I have been able to execute certain functions with
    >> +respondsToSelector:, but new constants and such cannot be used. I
    >> tried changing the sdk to 10.5 and it did compile, but it won't run
    >> at
    >> all on 10.4. I'm sure there is a way to get this working, but I
    >> cannot
    >> find it in the documentation.
  • On Nov 19, 2007, at 2:33 PM, <ab_lists...> wrote:

    > The only way to ensure that your code is working on both platforms
    > is to first compile against the 10.4 SDK to outline the areas that
    > are missing because you're using 10.5 functionality.

    This is incorrect.

    In Xcode terminology, an "SDK" represents a set of operating system
    capabilities you want your software to use, while a "deployment
    target" represents the minimum version of the operating system you
    want your software to run on.

    Thus you can build against the Mac OS X 10.5 SDK, and set the Mac OS X
    Deployment Target to 10.4, and anything you use which is 10.5-only
    will be weak-linked and therefore NULL/nil/Nil when running on 10.4.
    Unfortunately you can't just directly use or subclass 10.5-only
    classes in this situation, since the Objective-C runtime can't handle
    the situation where these class references have been resolved to Nil,
    but that's pretty much the only restriction on using 10.5
    functionality in code that needs to run on 10.4 (or 10.4 functionality
    in 10.3, etc.).

    To determine what capabilities you can use on 10.4, there's no real
    substitute for the actual Mac OS X documentation.  It's worth reading
    to understand which features were added and modified in a particular
    release of Mac OS X, and the Xcode Research Assistant has a slice
    which will tell you the OS compatibility of any particular method call
    or class you're using.

      -- Chris
  • On 20 Nov 2007, at 02:39, Chris Hanson wrote:
    > On Nov 19, 2007, at 2:33 PM, <ab_lists...> wrote:
    >> The only way to ensure that your code is working on both platforms
    >> is to first compile against the 10.4 SDK to outline the areas that
    >> are missing because you're using 10.5 functionality.
    >
    > This is incorrect.
    >
    Technically you are correct but practically...

    <snip>
    > To determine what capabilities you can use on 10.4, there's no real
    > substitute for the actual Mac OS X documentation.  It's worth
    > reading to understand which features were added and modified in a
    > particular release of Mac OS X, and the Xcode Research Assistant has
    > a slice which will tell you the OS compatibility of any particular
    > method call or class you're using.
    >
    And there lies the problem: when you're buried in a lot of code and
    somewhere in your enthusiasm you've used some 10.5-isms you're not
    going to find them (been there, done that). Switching to the 10.4 SDK
    and compiling it will find at least some of the culprits. And that was
    what I was referring to. ;-)

    Cheers!
    Annard
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today