简体   繁体   中英

File in xcode project not found

I am getting an error:

Error: Lexical or Preprocessor Issue: 'Constants.h' file not found

When the code is run, the issue disappears and the app works fine.

How can I fix this?

two things:

  1. Do a product "clean" (CMD-SHIFT-K)
  2. Avoid over-including headers from headers.

This involves using forward declarations whenever possible in headers (only #include another header if you are extending the class or implementing a protocol in that header). Use forward declarations for classes and protocols in your headers; then do the actual #import in your .m files.

@class SomeTypeINeedWhichIsAClass;
@protocol SomeProtocolWhichIsUsedInMyMethodSignatures;

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