“令牌不是预处理器子表达式中的有效二元运算符"使用 UIKitForMac 时 [英] "Token is not a valid binary operator in a preprocessor subexpression" when using UIKitForMac

查看:40
本文介绍了“令牌不是预处理器子表达式中的有效二元运算符"使用 UIKitForMac 时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在尝试为 mac 编译我的 iOS 项目,当我尝试使用时

So I'm trying to compile my iOS project for the mac, and when I try to use

#if !targetEnvironment(UIKitForMac)

我从标题中得到错误.

我尝试将构建目标设置为 iOS 13,但似乎没有任何效果.

I tried setting the build target to iOS 13, but didn't seem to have any effect.

推荐答案

如果您使用的是 Objective-c 而不是 swift,您应该使用:

If you're using objective-c and not swift you should use:

#if !TARGET_OS_UIKITFORMAC
#endif

这篇关于“令牌不是预处理器子表达式中的有效二元运算符"使用 UIKitForMac 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆