简体   繁体   中英

Xcode lost it's code sense?

For some reason my Xcode project doesn't recognize (autocorrect) my code. It doesn't color-code text except for NSStrings (in red). It doesn't autofill things like it used to (eg if I would type "CGR" it would put in "CGRectMake:(x,y,width,height)" but not anymore. I don't remember at what point this started happening but it does work in my other projects. Any ideas?

BTW, deleting the derived data doesn't fix it. Nor does creating a new project and importing the files.

this issue has happened to me, I give you 3 sulutions, you can try them.

Solution 1:

  1. Open xcode;
  2. Open Organizer (Xcode-> Window-> Organizer-> Projects)
  3. Select your project and right click, then remove from Organize...
  4. Close xcode and reopen your project.

Solution 2:

  1. Open your project.
  2. Targets -> Building Settings, set Precompile Prefix Header = NO;
  3. repeat solution 1 (Sometimes the Precompile Prefix Header occurs a issue).

Solution 3:

  1. Using commandline.
  2. cd YourProject.xcode
  3. Delete items except project.pbxproj

Good luck.

Hah, figured it out! For some reason my project was split up in different folders. IE it was one folder with all the images, another with ViewController.h and another with ViewController.m. Moved all the files to the highest folder in the hierarchy and everything works great :) Thanks for all your help though!

I suppose it would be too easy for your text editing preferences to be wrong? Command-comma -> text editing.

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