简体   繁体   English

接口中的未知类FBLoginView

[英]Unknown class FBLoginView in Interface

I have added Facebook sdk in the bundle, and have added one view in xib whose class I have set as a 'FBLoginView' and has created outlet for the same as 'fbLoginView'. 我在捆绑中添加了Facebook sdk,并在xib中添加了一个视图,我将其设置为'FBLoginView',并创建了与'fbLoginView'相同的插座。 Now when I set delegate of that fbLoginView it throws an error Unknown class FBLoginView in Interface and [UIView setDelegate:]: unrecognized selector sent to instance 0xa553380 现在,当我设置fbLoginView的委托时,它会抛出错误接口中的未知类FBLoginView[UIView setDelegate:]:无法识别的选择器发送到实例0xa553380

I suspect that its not getting the FBLoginView class, i have set the oultlet properly although, can somebody please help me where could I be mistaken ? 我怀疑它没有得到FBLoginView类,我已经正确设置了oultlet虽然,有人可以帮助我在哪里可以弄错?

I had FacebookSDKResources.bundle added but still I got the error "Unknown class FBLoginView in interface builder" appearing in the xcode output pane. 我添加了FacebookSDKResources.bundle,但我仍然在xcode输出窗格中出现错误“界面构建器中的未知类FBLoginView”。

To fix this I added the following line to didFinishLaunchingWithOptions : 为了解决这个问题,我在didFinishLaunchingWithOptions添加了以下行:

[FBLoginView class];

This is explained in https://developers.facebook.com/ios/login-ui-control/ 这在https://developers.facebook.com/ios/login-ui-control/中有解释。

i Know you are beginner but you have to read Developer.facebook there is very nice explanation. 我知道你是初学者,但你必须阅读Developer.facebook有很好的解释。 as well as they give you example code also check and match with your. 以及他们给你的示例代码也检查和匹配你的。 you did very minor mistake for place a code. 你做了一个非常小的错误代码。

in to your .h side:- 进入你的.h方面: -

#import <FacebookSDK/FacebookSDK.h>
@interface LoginViewController : UIViewController<FBLoginViewDelegate>
{
    FBLoginView *loginview;
}
@property (strong, nonatomic) id<FBGraphUser> loggedInUser;

if you are trying fatch user profile pic might be you are forget to set this line of code in to app delegate:- 如果您正在尝试fatch用户个人资料图片可能是您忘记将此行代码设置为app delegate: -

[FBProfilePictureView class]; or [FBLoginView class]; [FBLoginView class]; in to didFinishLaunchingWithOptions method. in to didFinishLaunchingWithOptions方法。

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

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