美文网首页
input is not a PCH file / file *

input is not a PCH file / file *

作者: 叫我逗Bee | 来源:发表于2019-06-27 18:29 被阅读0次

出错原因:

swift混编oc时,需要设置桥接头,桥接头文件用.h文件,不要用.pch

  1. 新建桥接头文件:**.h


    image.png
  2. 项目工程的Build Settings中,搜索bridging,设置Objective-C Bridging Header为头文件路径:$(SRCROOT)/头文件所在路径/头文件.h


    image.png
  3. 在桥接头文件里即可import oc类的头文件,在swift中就可以使用对应类了


    image.png
    image.png
    image.png

相关文章

网友评论

      本文标题:input is not a PCH file / file *

      本文链接:https://www.haomeiwen.com/subject/qeqdcctx.html