[英]Unresolved identifier “PFFacebookUtils” in swift in Xcode6
I am trying to have users login to facebook with parse but am receiving the compiler error "Use of unresolved identifier" for PFFacebookUtils, Parse, FBAppCall, and an invalid DidBecomeActive 我正在尝试让用户使用解析登录Facebook,但是收到PFFacebookUtils,Parse,FBAppCall和无效的DidBecomeActive的编译器错误“使用未解析的标识符”
This question has been posted before and the solution was to add the parsefacebookutils framework into your project and import it into the header file. 该问题之前已经发布过,解决方案是将parsefacebookutils框架添加到您的项目中,并将其导入到头文件中。 However, I have already added the framework to my project and imported it into my header file by adding the following to the my header.
但是,我已经将框架添加到我的项目中,并通过将以下内容添加到我的头文件中将其导入到我的头文件中。
#import <Parse/Parse.h>
#import <ParseFacebookUtils/PFFacebookUtils.h>
#import <FacebookSDK/facebookSDK.h>
I am still getting the error. 我仍然遇到错误。 The following is the code from my appdelegate file:
以下是我的appdelegate文件中的代码:
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
PFFacebookUtils.initializeFacebook()
Parse.setApplicationId("parseAppId", clientKey:"parseClientKey")
}
return true
}
func application(application: UIApplication,
openURL url: NSURL,
sourceApplication: String,
annotation: AnyObject?) -> Bool {
return FBAppCall.handleOpenURL(url, sourceApplication:sourceApplication,
withSession:PFFacebookUtils.session())
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
FBAppCall.handleDidBecomeActiveWithSession(PFFacebookUtils.session())
}
Could you please take a look at my code above? 您能看看我上面的代码吗? Not sure what the solution is.
不知道解决方案是什么。
Figured it out. 弄清楚了。 You have to go into the Build Settings - Objective C Header and then type the path to your header in the debug name.
您必须进入“构建设置-目标C标头”,然后在调试名称中键入标头的路径。 For example ProjectName/HeaderName.h as according to where I had my file within my project.
例如,根据我在项目中存放文件的位置,查看ProjectName / HeaderName.h。 Normally you wouldn't have to do this, but it didn't populate for me when I created the header.
通常,您不必这样做,但是当我创建标题时,它对于我来说并没有填充。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.