简体   繁体   中英

Cocoa/Xcode - OSX retrocompatibility

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.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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM