所以我正在尝试为 mac 编译我的 iOS 项目,当我尝试使用
#if !targetEnvironment(UIKitForMac)
我从标题中得到了错误。
我尝试将构建目标设置为 iOS 13,但似乎没有任何效果。
Objective-C
#if !TARGET_OS_MACCATALYST
// Code to exclude from Mac.
#endif
Swift
#if !targetEnvironment(macCatalyst)
// Code to exclude from Mac.
#endif
Sources:
https://developer.apple.com/documentation/uikit/creating_a_mac_version_of_your_ipad_app?language=objc https://developer.apple.com/documentation/uikit/creating_a_mac_version_of_your_ipad_app?language=objc
https://developer.apple.com/documentation/xcode/creating_a_mac_version_of_your_ipad_app https://developer.apple.com/documentation/xcode/creating_a_mac_version_of_your_ipad_app
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)