简体   繁体   中英

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:

在此输入图像描述

在此输入图像描述

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.

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.

新安装XCode IDE 6.1版

  1. Use CMD + F to find all _element .
  2. Check that if you named one variable _element

The following code may reproduce the error:

class _element:NSObject {
}
let _element:UIImage = UIImage()
// type _element under this line

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM