今天在object-c 和swift 混编的时候出现错误:could not build module foundation
当我把oc代码导入swift工程时候没有出来,编译是正常的,当我建立pch文件引用时候就出现could not build module foundation
这个问题折腾了好久,在网上找到解决办法,我把这个问题记录下,希望能帮到有需要的人
解决方法:
在pch 找到需要引用的的头文件前面加上#ifdef OBJC 要导入的头文件 #endif
如下图:

https://stackoverflow.com/questions/19723392/adding-c-file-causes-pch-error
网友评论