Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode going crazy! while coding, loses classes, references and doesn't autocomplete giving often <<error type>>

After I installed the latest version of xcode i'm having a very annoying issue.

While I'm coding, xcode goes nuts. Without me doing anything weird, just typing code, xcode stop recognizing classes.

For example: I want to add UITableViewDelegate to my class, but it doesnt recognize it. After i type it manually sometimes it recognize it and it is shown in purple, some other time it doesnt. But both times it won't really consider it, so if I try to write down a method of that delegate, it won't show it.

Other times if I try to call a variable of a certain class, while trying to autocompleting it, it shows <>.

Other times if I try to call any class, let's say I try to type var test = UIActionSheet, it just shows a few elements in the autocomplete list (raw types, primitives, the classes of my main project, but it doesn't show the majority of classes).

It's like it's missing the documentation and the link with the main frameworks...

I'm working on a simple tabbed app from yesterday and it's the 3rd time i started all over because of this issue, thinking that starting over would fix the issue, but it's not working.

If i open a different project while the issue is going on, the other project works ( but i recoded all over my app so it's not that one the issue, and i also have the same issue on other project... it just doesn't affect 2 project at the same time ) i tried deleting derived data i tried restarting both xcode and the comp

What's going on?

Here are two screenshoots where you can see what's happening:

enter image description here

enter image description here

like image 922
Marco Avatar asked Oct 20 '22 23:10

Marco


2 Answers

I had the same problem earlier.

Exit Xcode and delete Derived Data folder here ~/Library/Developer/Xcode Restart Xcode and you should see the autocomplete working again.

like image 98
Pancho Avatar answered Oct 26 '22 22:10

Pancho


You have to learn how to take it apart and put back together.

Either reinstall Xcode, if it doesn't help, create a new project. Then copy source files one by one and see when it breaks.

like image 35
piotrm Avatar answered Oct 26 '22 23:10

piotrm