我正在将 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/