简体   繁体   中英

Xcode wont suggest or autocomplete or connect

Hi from this morning i've got a weird thing !

Xcode won't Suggest ,

won't AutoComplete ,

won't give color to my codes ,

wont give me any Errors and won't find out my properties or methods or anything !

But indexing compelete with success

Build compelete with success

Run compelete with success

在此处输入图片说明

Restart your Xcode. If still not work, restart your computer.

I Had same problem , and i have solutions for that :

1.DerivedData :

Xcode caches some files that cause this problem

Go to --> YourUserName/Library/Developer/Xcode/

Then remove the DerivedData directory in the Xcode directory

if you didnt saw Library folder because it is a hidden directory

Here is a good Resource of how to show hidden files in macOS

2.Memory

clean up some memory , on devices that have 8GB of RAM this problem Occurred more

I suggest you to use CleanMyMac3 it also free a lot of Storage

You can download it from here

3.Code Clean !

I suggest you to code clean first !

a few things that i used to do in my Projects :

  1. For every method that only belongs to body of that class use fileprivate which means this method is available for the class and extenstions which just private is only available to the body of the class

  2. Any property that belongs only to body of the class should mark with fileprivate

  3. Avoid of declaring variables outside of the class ! this will get memory all the time

  4. Deinit() the Models after you end up working with them

  5. Avoid of doing Notification Center because you forget to dispose them ! instead of that i suggest you to start RxSwift that works better you can find it here

RxSwift

4. Code Completion

go to the Xcode->Preferences->TextEditing

Check that is your code completion options is checked to true

在此处输入图片说明

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