Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mantle:cannot find protocol declaration, 'MTLJSONSerializing'

I installed 'Mantle' using coco pod. But when I try to use it in my model, it is getting this error.

/Users/bgbb/Developer/experimental/MantleTest/MantleTest/TestMTL.h:11:32: Cannot find protocol declaration for 'MTLJSONSerializing'

#import "MTLModel.h"

@interface TestMTL : MTLModel <MTLJSONSerializing>

@end

This is my podfile.

platform :ios, '7.0'

pod 'Mantle', '1.1.2'

I am not sure what I am missing. Any clue?

like image 586
Imju Avatar asked Jan 17 '14 14:01

Imju


1 Answers

The protocol declaration for MTLJSONSerializing is in MTLJSONAdapter.h

While you could fix this by adding another import (#import "MTLJSONAdapter.h"), it's generally better to import a library or framework's umbrella header.

You should import Mantle's umbrella header to get access to all of the public interfaces in Mantle:

#import <Mantle/Mantle.h>

@interface TestMTL : MTLModel <MTLJSONSerializing>

@end
like image 169
David Snabel-Caunt Avatar answered Sep 22 '22 15:09

David Snabel-Caunt