Duplicate Symbol SBJSON on iOS Facebook SDK V 3.0

大城市里の小女人 提交于 2019-12-06 11:29:41

问题


In the current project, I used SBJSON everywhere and got it working fine with the previous version of iOS Facebook SDK since SBJSON was included in Facebook SDK.

I just upgraded to iOS Facebook SDK version 3.0 and having problem with SBJSON.

The first thing it complaint was about NOT finding SBJSON header file. So I thought, I could manually include the SBJSON lib into the project.

After I did that, then the compiler complaint that the SBJSON symbol was duplicated with the Facebook SDK.

I could not find the SBJSON.h anywhere in FB SDK headers.

So at the end, I went into a loop of problems.

Does anyone know how to solve this issue? The worst case could be that I have to switch to use other JSON library for iOS.

Note: They are using framework for Facebook SDK, not the source code library like before

Cheers


回答1:


What I ended up using to solve this are two approaches:

The first one

  • Firstly, not using the pre-built Facebook SDK framework that they provided
  • Secondly, check out the Facebook SDK source code from Facebook SDK and integrate it to the project

The second one

Integrate the Json-framework using their source code here and change the name of any duplicate class to something unique to your project like SBJsonParser to MySBJsonParser



来源:https://stackoverflow.com/questions/12041056/duplicate-symbol-sbjson-on-ios-facebook-sdk-v-3-0

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