简体   繁体   English

iOS中的Facebook SDK集成显示错误“类消息的接收方'Facebook'是前向声明”

[英]Facebook SDK integration in iOS shows Error “Receiver 'Facebook' for class message is a forward declaration”

I am using Facebook-iOS-SDK for integrating the Facebook in my app. 我正在使用Facebook-iOS-SDK将Facebook集成到我的应用程序中。 (The SDK is installed using cocoaPods) It always showing an error "Facebook.h not found" error when I try to import the Facebook.h class. (使用cocoaPods安装了SDK。)当我尝试导入Facebook.h类时,它始终显示错误"Facebook.h not found"错误。

And I tried the @class Facebook; 我尝试了@class Facebook; in my view controller's .h class and created the Facebook class instance. 在我的视图控制器的.h类中,并创建了Facebook类实例。 But i can't call any method of that class, when trying to call a method, it shows an error " Receiver 'Facebook' for class message is a forward declaration" 但是我无法调用该类的任何方法,当尝试调用一个方法时,它显示错误" Receiver 'Facebook' for class message is a forward declaration"

Is there any way to use the methods in the Facebook.h class. 有没有办法使用Facebook.h类中的方法。

Thanks for any help. 谢谢你的帮助。

Hi Neenu if you are using OS X Yosemite, try updating the command line tools and reinstalling pod file also you can try to set the path of Xcode using this command : Neenu,您好,如果您使用的是OS X Yosemite,请尝试更新命令行工具并重新安装Pod文件,也可以尝试使用以下命令设置Xcode的路径:

sudo xcode-select --switch "/Applications/Xcode6-Beta6.app/Contents/Developer". sudo xcode-select --switch“ /Applications/Xcode6-Beta6.app/Contents/Developer”。

If this doesn't solve the issue there is problem with pod file installation.Hope it helps 如果这不能解决问题,则说明Pod文件安装存在问题。希望对您有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM