ios - 使用未声明的标识符 'Fabric'

标签 ios twitter

我正在将 Twitter Fabric 集成到我的应用程序中。当我尝试使用 Fabric 将我的 key 保存在我的 Info.plist 中时出现错误。有任何想法吗?在文档中它说:

To initialize the Twitter Kit with your app’s credentials, pass them to startWithConsumerKey:consumerSecret: before passing the shared instance to Fabric.

Calling startWithConsumerKey:consumerSecret: will override any keys which were automatically configured. Automatically configured keys live in your app’s Info.plist under the key Fabric.

[[Twitter sharedInstance] startWithConsumerKey:@"your_key"
                                    consumerSecret:@"your_secret"];
[Fabric with:@[[Twitter sharedInstance]]]; //<--Gettings Use of undeclared Identifier 'Fabric' error

最佳答案

必须在此处包含 Fabric header ,它是包括 TwitterKit 在内的所有子库的父框架。

添加:

#import <Fabric/Fabric.h>

到您的 .m 文件。确保您也已将 Fabric 框架添加到您的 Xcode 项目中(它与 TwitterKit 框架是分开的)。

关于ios - 使用未声明的标识符 'Fabric',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27931269/

相关文章:

ios - UICollectionview 不起作用,我没有收到任何 Cell

iphone - NSXMLParser 遇到特殊字符后停止解析

iphone - 使用 NSUserDefaults 保存和显示数据

javascript - 如果只有一行很重要,为什么我需要 Twitter 上的所有困惑内容?

php - 在 Twitter Search API 1.1 中排除转推

c# - 如何使用 LinqToTwitter 获取标签上的所有推文

ios - NSManagedObjectContext 扩展中的通用函数中的奇怪 Swift 行为

ios - UIButton 不在 UIWindow 的 subview 上工作

PhoneGap + ChildBrowser 中的 Android + Twitter 集成

python - 在 tweepy 上创建 Twitter 线程不起作用