Using SBJson with facebook sdk static library

青春壹個敷衍的年華 提交于 2019-12-10 12:07:45

问题


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:


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];


来源:https://stackoverflow.com/questions/11834301/using-sbjson-with-facebook-sdk-static-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!