错误如下:
这种错误一般发生在C或C++与OC混编的时候,例如OC项目中引用了C或C++编写的第三方库。
如果项目中使用了pch,确保#import的库包含在#ifdef __OBJC__ #endif(If they're outside of this conditional scope, the compiler will try to import Objective-C frameworks into C source code)
例如:
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif