Cannot find protocol declaration for 'FBLoginV

2019-08-07 03:10发布

问题:

For some reason I'm getting the error Cannot find protocol declaration for 'FBLoginViewDelegate' when trying to include the FBLoginViewDelegate protocol to my ViewController interface.

I've searched for other similar questions but most of them seem to be related to circular inclusions...I don't think that's the case for me.

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController <UITextFieldDelegate, FBLoginViewDelegate>

//Properties    
@property (weak, nonatomic) IBOutlet UITextField *txtPassword;
@property (weak, nonatomic) IBOutlet UITextField *txtEmail;
@property (weak, nonatomic) IBOutlet UILabel *lblResult;

- (IBAction)loginClicked:(id)sender;
- (IBAction)backgroundTap:(id)sender;

@end

I'm quite new to iOS development and any help would be greatly appreciated!

回答1:

just remove and add the add the FacbookSDK and

make it

 #import<FacbookSDK/FaceBookSDK.h> in your VC.h file or .pch file (the compiler takes the Facebook delegate in all VC's)

finally clean and run your project, it surely works