问题
I am using Facebook iOS SDK 3.5 in my ipad App. I added framework, setup everything and everything is working fine. But when I copied my project source code to some other place other than where it is currently and build the project again, I get an XCode Apple Mach-O Linker Warning as directory not found [CURRENT_APPLICATION_PATH]/../../FacebookSDK.
After searching for sometime, I found out that in XCode Build Settings, FRAMEWORK_SEARCH_PATHS
has a path as "$(SRCROOT)/../../FacebookSDK"
which is what I think is the cause for that warning. If I remove that, I am getting error messages at all #import <FacebookSDK/FaceSDK.h>
statements.
So obviously, I need that above mentioned FRAMEWORK_SEARCH_PATHS.
But how would I get rid of that Xcode warning?
回答1:
This is due to your faceBook SDK missing error. Solution for this problem is that delete facebook sdk from your project and re add it. Remember that When you add faceBook SDK in your project tick copy checkbox inside "Choose option for adding these file" popup window which add facebook sdk permanently for your project.
OR
if it is showing just warning at compile time then you can follow this procedure too
1.> go to your project-xcode ,right click , show in finder, yourProjectName.xcodeproj would show
2.> now right click on yourProjectName.xcodeproj and go show package contents, choose and open project.pbxproj file into textEditor and serach facebook and delete following lines. and save and compile
"\"$(SRCROOT)/../../../Documents/FacebookSDK\"",
"\"$(SRCROOT)/../../../../Documents/FacebookSDK\"",
"\"$(SRCROOT)/../../../../../Downloads/SKYPE/Sproutt BACKUP/FacebookSDK\"",
"\"$(SRCROOT)/../../../../../../Documents/FacebookSDK\"",
"\"$(SRCROOT)/../../../../../../Documents/FacebookSDK 3\"",
"\"$(SRCROOT)/../../../../../Documents/FacebookSDK\"",
NOTE :- Don't quit textEditor until you make all changes because if any problem occur then you can UNDO your changes.
I hope it work. Please let me know if any problem you would have face. Thanks
回答2:
You should simply do ~/Documents/FacebookSDK
and it will work for any user cloning your project and storing FacebookSDK in his Documents folder
来源:https://stackoverflow.com/questions/16434394/facebook-ios-sdk-framework-search-path