iPhone ARC & Facebook SDK

前端 未结 4 901
别那么骄傲
别那么骄傲 2021-01-18 17:06

I\'m getting all kinds of build errors with Facebook\'s SDK because my app uses ARC. I try to remove the Facebook files from the compiler to avoid this, but I get an Apple M

相关标签:
4条回答
  • 2021-01-18 17:28

    The new SDK does not explicitly support ARC out of the box, but there is a shell scrip to build a static library that can be used within your ARC project. Just navigate to your local git repo and run

    % ~/facebook-ios-sdk/scripts/build_facebook_ios_sdk_static_lib.sh
    

    This will create the static library under the /lib/facebook-ios-sdk folder (e.g. ~/facebook-ios-sdk/lib/facebook-ios-sdk). You may then drag the facebook-ios-sdk folder into the app Xcode project to include the iOS Facebook SDK static library.

    0 讨论(0)
  • 2021-01-18 17:37

    there are actually very few changes needed to make the Facebook iOS sdk compatible with ARC. I have made the changes in my code , but , I do not know who to send it back to the community, any pointers ?

    here is a post I made to explain how to use it with ARC the simple way on Xcode 4.2: http://nabtech.wordpress.com/2012/02/02/facebook-ios-sdk-and-arc/

    0 讨论(0)
  • 2021-01-18 17:49

    And this is why distributing a shared library by copy and pasting files is bad. A library should be distributed as it's own Xcode projects with a static library target, so that the build setting requirements of your projects and the libraries you use can not screw up one or the other.

    File a bug for the Facebook SDK here: https://github.com/facebook/facebook-ios-sdk/issues

    And in the mean time add the -fno-objc-arc flag to the implementation files in the Facebook SDK. You can do this by;

    1. Select your application target
    2. Go to the Build Phases tab
    3. Add for each file under the Compile Sources section.
    0 讨论(0)
  • 2021-01-18 17:52

    Do you exclude them from arc with Compiler flag -fno-objc-arc ? You can see a Answer here

    0 讨论(0)
提交回复
热议问题