我需要的帮助太糟糕了。

我在这里已经进行了一段时间的快速编程,但似乎似乎找不到以前遇到过此问题的人。

让我描述一下问题:
每当我尝试运行我的应用程序时,它就会在AppDelegate中崩溃,就在第一行带有“SIGABRT”的位置。市政厅说:“使用Parse之前,必须在registerSubclass上注册PFUser类。”,这使我完全不知所措,因为我没有将任何可以远程访问PFUser的子类化。

我认为这与我一直在尝试集成的FacebookSDK(4.something,截至7月2日最新)有关,但是即使将其从项目中删除,它仍然会损坏。也可能与我刚刚将Parse更新为1.7.5有关,但我真的不知道了。

这是我尝试过的

  • 清洁,重建,重新启动等。
  • 在应用程序委托中使用“导入解析”导入解析,而不使用标头桥。
  • 多次重新安装所有框架。
  • 更改didFinishLaunchingWithOptions中的事物顺序

  • 这是我的代码:
    import UIKit
    import iAd
    @UIApplicationMain
    class AppDelegate: UIResponder, UIApplicationDelegate {
    
    
    
    var window: UIWindow?
    var UIiAd: ADBannerView = ADBannerView()
    
    
    func application(application: UIApplication,didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]!) -> Bool {
    
        Parse.setApplicationId("2NFm7aqXQIdO0JCaxH8bwveJhRhV5iEGQWDVpDgO", clientKey: "jIhPRyAXdUVnKuFh7ka7OAQjp2pcVi0LB2WWNXcg")
    
        PFAnalytics.trackAppOpenedWithLaunchOptionsInBackground(launchOptions, block: nil)
    
        GMSServices.provideAPIKey("AIzaSyAM5ff80Oc-1n9UJV1wZjX6ElFP-6PD2eI")
    
        FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
    
    
    
        FBSDKLoginManager.renewSystemCredentials { (result:ACAccountCredentialRenewResult, error:NSError!) -> Void in }
    
    
    
    
        PFPurchase.addObserverForProduct("kinkstrtext.addevent") {
            (transaction: SKPaymentTransaction?) -> Void in
            println("purchased");
        }
    
        let notificationTypes:UIUserNotificationType = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound
    
        if application.respondsToSelector("isRegisteredForRemoteNotifications")
        {
            // iOS 8 Notifications
    
            let notificationSettings:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: notificationTypes, categories:nil)
    
    
            UIApplication.sharedApplication().registerUserNotificationSettings(notificationSettings)
        }
        else
        {
            // iOS < 8 Notifications
            application.registerForRemoteNotificationTypes(.Badge | .Sound | .Alert)
    
        }
    
    
        var navigationBarAppearace = UINavigationBar.appearance()
    
        var btnColor:UIColor
        btnColor = UIColor(red: 0.99, green: 0.99, blue: 1, alpha: 1)
        var barColor:UIColor
        barColor = UIColor(red: 0.706, green: 0.506, blue: 0.678, alpha: 1.0)
        var titleColor:UIColor
        titleColor = UIColor(red: 0.99, green: 0.99, blue: 1, alpha: 1)
    
        UIApplication.sharedApplication().statusBarStyle = .LightContent
    
    
        navigationBarAppearace.tintColor = btnColor  // Back buttons and such
        navigationBarAppearace.barTintColor = barColor  // Bar's background color
    
        navigationBarAppearace.titleTextAttributes = [NSForegroundColorAttributeName:titleColor]  // Title's text color
    
        return true
    }
    
    func application(application: UIApplication, didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings) {
    
        UIApplication.sharedApplication().registerForRemoteNotifications()
    
    }
    
    func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
    
        let currentInstallation:PFInstallation = PFInstallation.currentInstallation()
        currentInstallation.setDeviceTokenFromData(deviceToken)
        currentInstallation.saveInBackground()
    
    }
    
    func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
    
        println(error.localizedDescription)
    
    }
    
    func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
    
        NSNotificationCenter.defaultCenter().postNotificationName("getMessage", object: nil)
    
    }
    
    func applicationWillResignActive(application: UIApplication) {
    }
    
    func applicationDidEnterBackground(application: UIApplication) {
    }
    
    func applicationWillEnterForeground(application: UIApplication) {
    }
    
    func applicationDidBecomeActive(application: UIApplication) {
        FBSDKAppEvents.activateApp()
    }
    
    func applicationWillTerminate(application: UIApplication) {
    }
    
    func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
        return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
    }
    

    }

    这是我的标题:
    #import <Parse/Parse.h>
    #import <ParseFacebookUtilsV4/PFFacebookUtils.h>
    #import <Bolts/Bolts.h>
    
    #import <GoogleMaps/GoogleMaps.h>
    
    #import <FBSDKCoreKit/FBSDKCoreKit.h>
    #import <FBSDKLoginKit/FBSDKLoginKit.h>
    

    任何帮助都将是惊人的!

    谢谢,

    -麦克林

    最佳答案

    使用最新的SDK,以我的经验,您实际上并不需要桥接头,将SDK添加到其中实际上会引起问题!因此,请尝试从标头中删除它们,并在使用它们的类中使用导入。

    import Parse
    import FBSDKCoreKit
    import FBSDKLoginKit
    

    关于ios - Swift使Parse/FaceBookSDK崩溃,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31530102/

    10-10 19:08