I wrote a Cocoa app on my Mac which is 10.6.6. I sent it to a friend who has 10.5.7 and they got this error:
Cannot open this app with this version of OSX
How can I make my app retrocompatible with minimum 10.开发者_JS百科4 Tiger ?
Set the Mac OS X Deployment Target in your Target build settings to OS X 10.4. And make sure to not use any 10.5 or 10.6-only APIs without checking for their availability first.
For 10.5 you can set the deployment target to 10.5 and make sure you only use APIs available in 10.5 (you should get warnings for 10.6 only APIs).
For 10.4, you'll probably need to install the 10.4 SDK from the Xcode install and use that SDK. If you have any properties declared, you'll also have to change them to getter/setter pairs and manually implement the getter/setters for synthesized properties.
If at all possible, you should avoid having to support 10.4 because the runtime predates Objective-C 2.0.
精彩评论