FBSDKCoreKit 框架,在 xCode 7 协议 FBSDKApplicationDelegate 无法识别

FBSDKCoreKit Framework, in xCode 7 Protocol FBSDKApplicationDelegate doesn't recognized

我下载了最新的Facebook SDK 4.6版 我在此处阅读 IOS SDK 入门:https://developers.facebook.com/docs/ios/getting-started/

我把FBSDKCoreKit.Framework像导播一样拖放到项目里面

在 AppDelegate.m 的 header 我写道:

//-----
#import <FBSDKCoreKit/FBSDKCoreKit.h>

@interface AppDelegate () <FBSDKApplicationDelegate>

@end
//----

我完成了入门指南的所有内容.... 那么,我的问题是:

Cannot find protocol declaration 'FBSDKApplicationDelegate' did you mean 'UIApplicationDelegate'?

FBSDKCoreKit/FBSDKCoreKit.h识别良好,FBSDKApplicationDelegate.h在框架内,框架搜索路径在应用程序设置中....

问题出在哪里?我找不到它

信息: XCode 7.0, FBSdk 4.6, 部署目标 9.0

您不必像以前那样实现委托。

而不是:

//-----
#import <FBSDKCoreKit/FBSDKCoreKit.h>

@interface AppDelegate () <FBSDKApplicationDelegate>

@end
//----

你需要这个

//-----
#import <FBSDKCoreKit/FBSDKCoreKit.h>

@interface AppDelegate () 

@end
//----

下一个方法的返回值必须是

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

   // your code

  return [[FBSDKApplicationDelegate sharedInstance] application:application
    didFinishLaunchingWithOptions:launchOptions];
}

那你就要实现这个方法了:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  return [[FBSDKApplicationDelegate sharedInstance] application:application
    openURL:url
    sourceApplication:sourceApplication
    annotation:annotation
  ];
}

就这些了。