加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ios – Xcode 8语法高亮不起作用

发布时间:2020-12-15 01:51:49 所属栏目:百科 来源:网络整理
导读:上面的代码在Xcode 7中具有正确的语法高亮。它是Obj-C Swift的混合: 我已经更新了支持Xcode 8的项目,只有少数东西被改变了: 在Build Settings中支持Swift 2.3 并修复了与UIKit隐式展开属性相关的几个错误 在为Xcode 8编译完所有项目之后。 但是在Swift中
上面的代码在Xcode 7中具有正确的语法高亮。它是Obj-C Swift的混合:

enter image description here

我已经更新了支持Xcode 8的项目,只有少数东西被改变了:

>在Build Settings中支持Swift 2.3

enter image description here


>并修复了与UIKit隐式展开属性相关的几个错误

enter image description here

在为Xcode 8编译完所有项目之后。

但是在Swift中集成的Obj-C代码没有任何语法高亮,反之亦然:

enter image description here

并且有<<错误类型>>自动完成问题:

enter image description here

派生数据删除没有帮助,Xcode重启:) CocoaPods版本0.38.2,iOS 7

解决方法

这个答案帮助我 https://forums.developer.apple.com/thread/46223我的一个项目:

I got help from an apple engineer at WWDC on this issue and resolved
it. The problem stemmed from cocoapods… Apparently cocoapods was
copying .h files into the build directory and SourceKit was getting
confused. I’m not entirely sure why the .h files were being copied –
they aren’t needed there. So the fix was to add a post-build script
in your build phases section that removes the headers after a build.
It would look something like this:

function removeHeaders() {  
    find $BUILD_ROOT/Debug-iphonesimulator/  -name '*.h' -exec rm -f {} ;  
}  
removeHeaders

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读