Iphone Mantle:找不到协议声明&x27;MTLJsonserialization';

Iphone Mantle:找不到协议声明&x27;MTLJsonserialization';,iphone,cocoapods,github-mantle,Iphone,Cocoapods,Github Mantle,我用可可豆荚安装了“Mantle”。但是当我尝试在我的模型中使用它时,它得到了这个错误 /Users/bgbb/Developer/experimental/MantleTest/MantleTest/TestMTL.h:11:32:找不到“mtljsonserialization”的协议声明 #import "MTLModel.h" @interface TestMTL : MTLModel <MTLJSONSerializing> @end 我不确定我错过了什么。有线索吗

我用可可豆荚安装了“Mantle”。但是当我尝试在我的模型中使用它时,它得到了这个错误

/Users/bgbb/Developer/experimental/MantleTest/MantleTest/TestMTL.h:11:32:找不到“mtljsonserialization”的协议声明

#import "MTLModel.h"

@interface TestMTL : MTLModel <MTLJSONSerializing>

@end

我不确定我错过了什么。有线索吗

MTLJSONSerialization的协议声明在
MTLJSONAdapter.h

虽然您可以通过添加另一个导入(
#import“MTLJSONAdapter.h”
)来解决此问题,但通常最好导入库或框架的伞头

您应该导入Mantle的伞形标题以访问Mantle中的所有公共接口:

#import <Mantle/Mantle.h>

@interface TestMTL : MTLModel <MTLJSONSerializing>

@end
#导入
@接口测试MTL:MTL模型
@结束
#import <Mantle/Mantle.h>

@interface TestMTL : MTLModel <MTLJSONSerializing>

@end