首页 > 解决方案 > 如何在 if 包含错误条件

问题描述

在目标 c 中,如何有错误的条件#if __has_include

就像我试过这个

#if __has_include(!"RNFileViewerManager.h")

但它说

应为“文件名”或 <文件名>

预处理器表达式开头的标记无效

目标RNFileViewerManager:我收到重复符号错误,如果不存在我只想加载我的代码

标签: iosobjective-cxcode

解决方案


使用该方法的正确方法是

#if __has_include(<frmaework/filename.h>)
  something *h = [something new]
#else
  other *h = [other new]
#endif

试试这个并检查你是否收到错误。


推荐阅读