它向我顯示此錯誤。 我所做的只是下載了Facebook SDK用的CocoaPods,我嘗試登錄,但不能這個錯誤=(因爲Objective-C:「用於類消息的接收者FBSDKAccessToken是前向聲明」
FBSDKAccessToken和FBSDKGraphRequest與此相同的錯誤...
這是我的代碼:
#import "TestesViewController.h"
#import "FBSDKCoreKit.h"
#import "FBSDKLoginKit.h"
@implementation TestesViewController
-(void) viewDidLoad {
[super viewDidLoad];
FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc]init];
loginButton.readPermissions = @[@"public_profile", @"email", @"user_friends"];
loginButton.center = self.view.center;
[self.view addSubview:loginButton];
}
- (IBAction)loadButton:(id)sender {
if ([FBSDKAccessToken currentAccessToken]) {
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSLog(@"fetched user:%@", result);
}
}];
}
}
@end
感謝您的答案。不修正錯誤,甚至改變標題搜索路徑,錯誤繼續... =/ –