Issues when installing th json framework on xcode4

…衆ロ難τιáo~ 提交于 2019-12-08 08:50:40

问题


Hello I am trying to install json framework. According to installation instructions I have to copy all the classes from json-framwork/classes in my project! I did that and I am getting this error:

ld: duplicate symbol _OBJC_METACLASS_$_SBJsonParser in /Users/user/Library/Developer/Xcode/DerivedData/testhttp-eavsbuatbfoagsgbqfnevfpjxxfc/Build/Intermediates/testhttp.build/Debug-iphonesimulator/testhttp.build/Objects-normal/i386/SBJsonParser-4254E5B76E32172.o and /Users/user/Library/Developer/Xcode/DerivedData/testhttp-eavsbuatbfoagsgbqfnevfpjxxfc/Build/Intermediates/testhttp.build/Debug-iphonesimulator/testhttp.build/Objects-normal/i386/SBJsonParser-46310C881BFA9776.o for architecture i386 collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

What I am doing wrong here?


回答1:


Please have a look at:

iPhone: Duplicate Symbol Error?

Select the project navigator in the right sidebar. Double click your project(top element).

Now open the build phases tab. There is a section which is called Compile Sources. Open it an check if there is a duplice entry of the file which the error refers to.

My Installation of the json-framework

Just added these files to my project

Each .m file is here only once

In the class I need JSON parsing I'll just import:

#import "JSON.h"



回答2:


I just erase the .m and .h files from JSON Framework wich the compilator was giving me errors, at the end I just keep from the JSON Framework: NSObject+SBJSON, NSSTring+SBJSON .h and m. This worked for me, I hope it helps :D



来源:https://stackoverflow.com/questions/6130568/issues-when-installing-th-json-framework-on-xcode4

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