Question

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'. 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

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 ?

Était-ce utile?

La solution 2

i Know you are beginner but you have to read Developer.facebook there is very nice explanation. 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:-

#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:-

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

Autres conseils

I had FacebookSDKResources.bundle added but still I got the error "Unknown class FBLoginView in interface builder" appearing in the xcode output pane.

To fix this I added the following line to didFinishLaunchingWithOptions :

[FBLoginView class];

This is explained in https://developers.facebook.com/ios/login-ui-control/

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top