且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

未加载库

更新时间:2022-11-30 15:38:28

我得到这个确切的错误。我的应用程序目前的部署目标为5.1。我想添加Facebook分享。我找到了这个旧帖子,有条件地包含针对不同iOS SDK的库版本?。所有我做的是将Social.framework设置为可选,它做的伎俩,然后我的应用程序将运行在ios 5.1和ios 6.0。当然,您需要在运行时检查设备运行的操作系统,否则如果您尝试访问ios 5.1或更早版本中的social.framework,您可能会遇到崩溃。希望有所帮助!

I was getting this exact error. My app currently has a deployment target of 5.1. I wanted to add Facebook sharing. I found this old post, Conditionally including a library for different iOS SDK versions?. All I did was set "Social.framework" to 'optional' and it did the trick, then my app would run on ios 5.1 and ios 6.0. Of course you need to do checks at runtime for what OS the device is running otherwise you could run into a crash if you try to access social.framework in ios 5.1 or earlier. Hope that helps!