Lost completion in #import “myFile.h”

2 Solutions Collect From Internet About “Lost completion in #import “myFile.h””

Go to your project –> build settings –> User Header Search Paths and add $(SRCROOT)

That works for me.

Edit (another solution) :
Sometimes I lost autocompletion randomly in my import scope. I fix it by typing the double quotes #import "" before typing my class between with the autocompletion.

Apparently this is related to having your files inside subfolders. It seems that while previous versions of Xcode’s codesense would list any headers added to your project, version 4.4 only lists the ones in the topmost folder in your project…

The solution I’ve found is to include those subfolders in the project’s “User Header Search Paths”.

For example, if you have a folder structure like this:

Source/
  Example/
    Util/
      util.h
  Example.xcodeproj

By default, when you type

#import "u|"

you’ll get the suggestion for the Util folder. If you let it complete that and continue typing:

#import "Util/u|"

you’ll get the util.h suggestion.

To get the usual autocomplete behavior, go to your project –> build settings –> User Header Search Paths and add Example to the list (double click on the setting, click the “+” button, write Example and make sure to turn on the checkbox to the left). When you close the little pop up, your setting should read something like Example/**, which means it’s including Example and every subfolder.

The new behavior (feature? bug?) was driving me crazy. Hope that helps.