Facebook FBSDKLoginManager logInWithReadPermissions:fromViewController:handler::发送到实例0x7fed38d61290的无法识别的选择器

Facebook FBSDKLoginManager logInWithReadPermissions:fromViewController:handler::发送到实例0x7fed38d61290的无法识别的选择器,facebook,heroku,swift2,ios9,xcode7,Facebook,Heroku,Swift2,Ios9,Xcode7,似乎无法解决这个问题。我进入并删除了所有的parse和fb SDK,然后下载了最新的parse和fb SDK并将其放入项目中 仍在日志中获取此错误。甚至连fb屏幕都没有。 下面是我的代码,如果你能帮助的话。我已经研究了这个问题的所有实例,但没有解决。我错过了一些东西 AppDelegate.swift: 导入UIKit 导入解析 导入ParseFacebookUtilsV4 进口螺栓 //如果要使用任何UI组件,请取消对此行的注释 //导入ParseUI //如果要使用崩溃报告-取消注释此行 /

似乎无法解决这个问题。我进入并删除了所有的parse和fb SDK,然后下载了最新的parse和fb SDK并将其放入项目中

仍在日志中获取此错误。甚至连fb屏幕都没有。 下面是我的代码,如果你能帮助的话。我已经研究了这个问题的所有实例,但没有解决。我错过了一些东西

AppDelegate.swift:

导入UIKit 导入解析 导入ParseFacebookUtilsV4 进口螺栓

//如果要使用任何UI组件,请取消对此行的注释 //导入ParseUI

//如果要使用崩溃报告-取消注释此行 //导入语法分析报告

@UIApplicationMain 类AppDelegate:UIResponder、UIApplicationLegate{

var window: UIWindow?

//--------------------------------------
// MARK: - UIApplicationDelegate
//--------------------------------------

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Enable storing and querying data from Local Datastore. 
    // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy.
    Parse.enableLocalDatastore()

    let parseConfiguration = ParseClientConfiguration(block: { (ParseMutableClientConfiguration) -> Void in
        ParseMutableClientConfiguration.applicationId = "xxx"
        ParseMutableClientConfiguration.clientKey = "xxx"
        ParseMutableClientConfiguration.server = "https://yourapp.herokuapp.com/parse"
    })

    Parse.initializeWithConfiguration(parseConfiguration)

    PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)

    PFUser.enableAutomaticUser()

    let defaultACL = PFACL();

    // If you would like all objects to be private by default, remove this line.
    defaultACL.publicReadAccess = true

    PFACL.setDefaultACL(defaultACL, withAccessForCurrentUser:true)

    if application.applicationState != UIApplicationState.Background {
        // Track an app open here if we launch with a push, unless
        // "content_available" was used to trigger a background push (introduced in iOS 7).
        // In that case, we skip tracking here to avoid double counting the app-open.

        let preBackgroundPush = !application.respondsToSelector("backgroundRefreshStatus")
        let oldPushHandlerOnly = !self.respondsToSelector("application:didReceiveRemoteNotification:fetchCompletionHandler:")
        var noPushPayload = false;
        if let options = launchOptions {
            noPushPayload = options[UIApplicationLaunchOptionsRemoteNotificationKey] != nil;
        }
        if (preBackgroundPush || oldPushHandlerOnly || noPushPayload) {
            PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions)
        }
    }

    if application.respondsToSelector("registerUserNotificationSettings:") {
        let settings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil)



        application.registerUserNotificationSettings(settings)
        application.registerForRemoteNotifications()
    } else {
        let types: UIRemoteNotificationType = [UIRemoteNotificationType.Badge, UIRemoteNotificationType.Alert, UIRemoteNotificationType.Sound]
        application.registerForRemoteNotificationTypes(types)
    }

    return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}

//--------------------------------------
// MARK: Push Notifications
//--------------------------------------

func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
    let installation = PFInstallation.currentInstallation()
    installation.setDeviceTokenFromData(deviceToken)
    installation.saveInBackground()

    PFPush.subscribeToChannelInBackground("") { (succeeded, error) in
        if succeeded {
            print("ParseStarterProject successfully subscribed to push notifications on the broadcast channel.");
        } else {
            print("ParseStarterProject failed to subscribe to push notifications on the broadcast channel with error = %@.", error)
        }
    }
}

func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
    if error.code == 3010 {
        print("Push notifications are not supported in the iOS Simulator.")
    } else {
        print("application:didFailToRegisterForRemoteNotificationsWithError: %@", error)
    }
}

func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
    PFPush.handlePush(userInfo)
    if application.applicationState == UIApplicationState.Inactive {
        PFAnalytics.trackAppOpenedWithRemoteNotificationPayload(userInfo)
    }
}

func application(application: UIApplication,
    openURL url: NSURL,
    sourceApplication: String?,
    annotation: AnyObject) -> Bool {

    return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}
func applicationDidBecomeActive(application: UIApplication) {
        FBSDKAppEvents.activateApp()
}   
}

ViewController.swift:

导入UIKit 导入解析 导入FBSDKCoreKit 导入FBSDKLoginKit 导入ParseFacebookUtilsV4

类ViewController:UIViewController{

override func viewDidLoad() {
    super.viewDidLoad()


    // array of what we want to get from the fb user account
    let permissions = ["public_profile"]

    PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) {
        (user: PFUser?, error: NSError?) -> Void in

        if let error = error { // if error exists

            print(error)

        } else {

            if let user = user { // if user exists

                print(user)
            }
        }
    }

}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}
}