Xcode 6代码编辑器不正常的行为 [英] Xcode 6 code editor erratic behaviour

查看:128
本文介绍了Xcode 6代码编辑器不正常的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,Xcode的6代码编辑器遇到了一些麻烦,在编辑窗口中快速改变了焦点,在同一个文件中跳转到完全不同的地方,同时编辑文本。这是一切都开始的。最近编辑拒绝上下滚动,挂起,停止显示行号或任何其他文字。
我可以做些什么来阻止行为不端?我发现的所有解决方案是关于旧版本的Xcode,不适合我。



更新:我最初以为是选配。我的代码中有一点我这样做:

  tile?.position.vertical> = 2 
我推测通过将可选值与一个值进行比较,我弄错了编译器,我应该只将它与零。随后的测试证明我错了。然后我注意到我的枚举之一:

 枚举图:Int {
case King = 0
case Pawn = 1
case Bishop = 3
case Knight = 5
case Rook = 7
case Queen = 9

func pieceName() - > String {
switch self {
case .Pawn:
returnPawn

case .King:
returnKing

case .Bishop:
returnBishop

case .Knight:
returnKnight

case .Rook:
returnRook

case .Queen:
returnQueen
}
}
}

注意代码在switch语句中很好地着色,显然Pawn,King等是同一枚举的一部分。嗯,不是我的情况。当我命令单击函数中的一个case值时,Xcode的副本将会显示Symbol not found。
那么你觉得这可能是我烦恼的罪魁祸首,如果是的话,我该怎么解决?

解决方案



我在Apple开发人员论坛中发现了这个问题的答案。不幸的是,我找不到线程。它基本上表示,我经历的行为是我使用的颜色主题的结果,它使用不同大小的字体,以及斜体和粗体的组合。事实是,这个家伙的帖子之后没有更多的评论,确认或反驳解决方案。对我来说,它做了这件事。而现在@Kirby Todd已经确认了,我将其作为答案发布。


As of recently I experience some troubles with Xcode's 6 code editor, which conclude in rapid change of focus in the editing window, jumping to a completely different place in the same file, while editing text. This is how it all started. Lately the editor refuses to scroll up and down, hangs, stops displaying the line numbers, or any other text altogether. What can I do to make it stop misbehave? All the solutions I found thus far are concerning older versions of Xcode and do not work for me.

Update: I initially thought it was the Optionals. There is a point in my code where I do this:

tile?.position.vertical >= 2

I presumed that by comparing the optional to a value, I messed with the compiler and I was supposed to compare it only to nil. Subsequent testing proved me wrong. Then I notices something in one of my enumerations:

enum Figure: Int {
     case King = 0
     case Pawn = 1
     case Bishop = 3
     case Knight = 5
     case Rook = 7
     case Queen = 9

     func pieceName() -> String {
        switch self {
        case .Pawn:
            return "Pawn"

        case .King:
            return "King"

        case .Bishop:
            return "Bishop"

        case .Knight:
            return "Knight"

        case .Rook:
            return "Rook"

        case .Queen:
            return "Queen"
        }
    }
}

Notice how nicely the code gets coloured in the switch statement, obviously Pawn, King and so on are a part of the same enumeration. Well, not in my case. My copy of Xcode will say "Symbol not found" when I command-click one of the case values in the function. So, what do you think could this be the culprit to my troubles and if yes, how can I fix it?

解决方案

Equalise all font sizes and remove any italics and bolds in your colour theme.

The answer to this issue I discovered in the Apple Developer forums. Unfortunately, I cannot find the thread there. It basically said that the behaviour I was experiencing was the result of a colour theme I was using having different sized fonts and a combination of italics and bolds. The thing is that there were no more comments after this guy's post, confirming or disproving the solution. For me, it did the thing. And now that @Kirby Todd has confirmed it, I am posting it as an answer.

这篇关于Xcode 6代码编辑器不正常的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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