#import“Facebook / Facebook.h”
你有几乎立即创建一个Facebook对象吗?我的SDK中似乎没有任何此文件.这本书已经过时了吗?它刚刚于去年秋天发布……
解决方法
我使用以下导入来访问Facebook SDK:
#import <FacebookSDK/FacebookSDK.h>
您的环境似乎没有Facebook框架.下载那个here.
更新
我找到了官方Facebook的答案.显然,这些是不推荐使用的标题,仍可用于向后兼容性.
请注意,在底部,如果在完成以下步骤后Xcode在识别导入时出现问题,请重新启动XCode.
Add the headers by dragging the DeprecatedHeaders folder from the
FacebookSDK.framework/Versions/A/DeprecatedHeaders folder into the
Frameworks section of your Project Navigator.Choose ‘Create groups for any added folders’ and deselect ‘Copy items
into destination group’s folder (if needed)’. This adds the headers as
a reference.Now,open up your app delegate header file and replace the Facebook
framework import with the Facebook header import.Change:
#import <FacebookSDK/FacebookSDK.h>
To:
#import "Facebook.h"
This allows you to make call to the FBDialog classes. The Facebook.h
header includes the
header files.Note: If you have any problems with Xcode recognizing the Facebook.h
file,just close and reopen your Xcode project.