title: How to avoid XCode framework weak-linking problems?
body: <p>I'm building an application that takes advantage of Mac OS X 10.6-only technologies, but without giving up backwards compatibility to 10.5 Leopard.</p>
  
  <p>The way I do this is by setting the 10.6 SDK as the base SDK, weak-linking all frameworks and setting the deployment target to 10.5 as described in:</p>
  
  <p><a href="http://developer.apple.com/mac/library/DOCUMENTATION/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html" rel="nofollow noreferrer">http://developer.apple.com/mac/library/DOCUMENTATION/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html</a></p>
  
  <p>This works fine; before making a call that is Snow Leopard-only I need to check that the selector or indeed the class actually exist. Or I can just check the OS version before making the call.</p>
  
  <p>The problem is that this is incredibly fragile. If I make a single call that is 10.6 only I blow Leopard-compatibility. So using even the normal code code completion feature can be dangerous.</p>
  
  <p>My question: is there any way of checking which calls are not defined on 10.5 before doing a release build? Some kind of static analysis, or even just a trick (a target set the other SDK?) would do.</p>
  
  <p>I obviously should test on a Leopard machine before releasing anything, but even so I can't possibly go through all paths of the program before every release.</p>
  
  <p>Any advice would be appreciated.</p>
  
  <p>Best regards,</p>
  
  <p>Frank</p>