Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10 & Xcode 11 Code Completion shows all objects as "int *"

I'm having a problem where autocomplete simply doesn't show up. For example, if I try accessing a window's rootViewController, the Intellisense view doesn't even appear. If I press Control-Space, all that appears is a tiny view which reads, "No Completions."

enter image description here

On the previous symbol, in this example, the window property on my object, Intellisense appears, but it identifies the property as being of type int *.

enter image description here

I have done all of the obvious things (perform a clean, clear derived data, restart Xcode, reboot device) but the issue persists.

I've found several pages (both StackOverflow and articles elsewhere) about similar, though not identical, issues and have yet to come up with a solution.

How can I get autocomplete working again?

like image 586
Joel Murphy Avatar asked Jan 28 '26 01:01

Joel Murphy


2 Answers

I am also having same problem, autocomplete is not working in my project. I have gone through following steps. And it worked

  1. Open your file/class in xcode and #import Foundation frameworks
  2. Open up build phases of your project in xcode. Add Foundation framework

    enter image description here

  3. Now go to your project folder from finder right click on your .xcodeproj file.Choose

    Show Package Contentsenter image description here

  4. Now choose select

    xcuserdata

    and delete the folder inside xcuserdata

enter image description here

  1. After deleting folder in above screenshot. Build your project and run. It will now work with autocomplete.
like image 126
Mohammad Kamran Usmani Avatar answered Jan 29 '26 15:01

Mohammad Kamran Usmani


This ended up being related to a non-portable path in an import, which was breaking Intellisense. My team has a large project with several other projects included as libraries. The main project would include one of them with:

#import "LibraryName/LibraryName.h"

In one instance, the library project was also performing this same import. I fixed this by having the library import the specific headers it needed from itself.

#import "LibraryComponent.h"
#import "NSString+LibraryCategory.h"
like image 31
Joel Murphy Avatar answered Jan 29 '26 13:01

Joel Murphy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!