ios – 找不到Facebook.h.

我正试图通过我离开亚马逊的Facebook SDK书籍.编码开始于
#import“Facebook / Facebook.h”
你有几乎立即创建一个Facebook对象吗?我的SDK中似乎没有任何此文件.这本书已经过时了吗?它刚刚于去年秋天发布……

解决方法

以下是最新的,对我来说是一个很好的资源: Getting Started with the 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 deselectcopy 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.

Source

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...