Search code examples
xcodecode-completion

In Xcode #import not showing code completion when just added .h c header


I added a MyHeaders.h header file from 'c and c++' section of iOS in xcode to import all other .h files in it, like how OCMock.h is having like below. It just has those 5 imports ignoring comments.

#import "OCMockObject.h"
#import "OCMockRecorder.h"
#import "OCMConstraint.h"
#import "OCMArg.h"
#import "NSNotificationCenter+OCMAdditions.h"

When i tried to add sixth line with #import code completion is showing up with valid values. But when i tried to do the same on MyHeaders.h code completion is not helping. What i might have missed? Please asssist.


Solution

  • Figured out that it works as long as this .h file is imported somewhere. As soon as you remove that import it stops helping code completion to choose framework or .h in its own import.

    Curious to understand why it is behaving this? If someone knew, please let me know.