Using SBJson with facebook sdk static library

2019-06-10 05:14发布

At the moment when I try to have the SBJson library alongside the facebook-ios-sdk I get

'duplicate interface definition for class 'SBJsonParser''

come up.

So I have created a static facebook-ios-sdk library and then I have also got my standard SBJson library in the same project. I get the error.

Can anyone suggest a way to fix this? I really need to use that library in my application... as I already have a good few thousand lines of code in this library and need to implement facebook too...

1条回答
迷人小祖宗
2楼-- · 2019-06-10 06:08

The facebook SDK already contains the SBJSON library. That is why you are getting a duplicate definition error. Try removing your SBJSON files and then #import "SBJSON.h", it should get the file from your facebook SDK.

Try: initWithData:encoding: NSString method.

NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSDictionary *dict = [responseString JSONValue];
查看更多
登录 后发表回答