IOS Adds C File Error [How to Solve]

Reason: This is actually the logic of using pch files in Xcode compilation, after introducing c files in the project, pch will mix #include and #import, in order to reduce compiler workload, you need to use precompiled macros to make a slight distinction.

Solution: Check all pch files in the project and put “#import xxx”, which is only used in OC, in “#indef __OBJC__” and “#endif”

#ifndef PrefixHeader_pch
#define PrefixHeader_pch

#ifdef __OBJC__

#import "Masonry.h"

#endif


#endif /* PrefixHeader_pch */

Read More: