Syntax color is very slow to appear with xcode 6.3.1

For several days (from the latest version of xcode?), I noticed that the syntax color sometimes appears, and sometimes does not even appear, then I need to "reload" the file by clicking on another file and returning to the current one.

I tried to solve this problem by deleting the received data, but this did not solve my problem. This is pretty annoying because it seems like I cannot click on a method (and go on to define it) if the syntax color is not ready.

Any idea?

+7
xcode xcode6
source share
2 answers

So, briefly, my problem was some lines of code that were hard to compile and took the whole process of compilation. This is probably due to my problem, because Xcode quickly compiles the file you are working on before including any internal link / color for the code.

So, if your compilation takes some time, here is how you can quickly find out what the problem is (if it is related to some of your lines of code)

So, I found some help on some website to find out what it was, but I can’t give you links since I don’t remember them. So, this is how I continue.

First, when you compile, go to the Report Navigator on the left and select the built Build . Then, on the main tab, try to find the file that takes some time to compile (this is the one that should stay with the arrow longer than the others). After you find it, select the file line and on the right side, a button will appear that opens a tab showing the command to compile your file using Terminal .

Copy the part starting with /Applications/Xcode.app/Contents/Developer/Toolchains to the end (name_of_your_file.o) and paste it into Terminal .

If you completed it, it will take no more than 3-4 seconds. Then, when you execute it, you must press Ctrl(^) + \ , you will send an output signal, and this will lead to the completion of the process and a core dump, showing you the line and the code that it compiles, so most likely the part that took a long time.

In my case, one of the problematic lines was

 maximumValue = CGFloat(abs(high + (15/100) * (high - low))) 

I will replace it with

 let maximumValue = abs(high + (15/100) * (high - low)) maximumValue = CGFloat(maximumValue) 

and he solved my problem. Why is this piece of code causing a problem, this is another question ...

+1
source share

I found that this too was a line that seemed too complicated to handle. I found that if I typed β€œlet bob = UII” at the very top of the class, the syntax highlighting was fast, while at the bottom of the file it was crazy slow. The simplest way I found was simply to try "let bob = UII" halfway, and then basically divide in half and again in half. My problem was computing a variable with a few calculations and additions. I broke it into 4 lines and everything is fine again.

0
source share

All Articles