美文网首页
oc与c混编出现的bug

oc与c混编出现的bug

作者: Flandreko | 来源:发表于2018-08-09 21:48 被阅读0次

在项目中导入c文件混编时,如果有pch工程文件的话,项目会报错。

#ifndef Prefix_pch
#define Prefix_pch

#import "Macros.h"
#import "Masonry.h"
#import "BKKBaseViewController.h"


#endif /* Prefix_pch */

要解决错误的话,要将import的头文件添加到#ifdef __OBJC__#endif之间

//#ifndef Prefix_pch
#define Prefix_pch
#ifdef __OBJC__


#import "Macros.h"
#import "Masonry.h"
#import "BKKBaseViewController.h"


#endif /* Prefix_pch */

相关文章

网友评论

      本文标题:oc与c混编出现的bug

      本文链接:https://www.haomeiwen.com/subject/taaqbftx.html