我需要幫助如此糟糕。Swift解析/ FaceBookSDK崩潰
我一直在這裏用swift進行編程,但我似乎無法找到以前有過這個問題的人。
讓我來描述一下這個問題: 每當我嘗試運行我的應用程序時,它會在AppDelegate中崩潰,在第一行使用「SIGABRT」。理事會說「'PFUser類在使用Parse之前必須先使用registerSubclass註冊。'」,由於我沒有對遠程接觸PFUser的任何東西進行分類,所以我完全不知所措。
我認爲這件事情做的FacebookSDK(4.something,最新的7月2日),我一直在努力整合,但即使當我從項目的事中刪除它仍然打破。也可能與我剛剛更新Parse到1.7.5有關,但我真的不知道了。
這是我已經試過
- 清洗,改造,重新啓動等
- 進口解析與「導入解析」在App代表中,而不是用頭橋。
- 重新安裝所有框架,多次。
- 更改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>
任何幫助將是驚人的!
感謝,
-MacLean
仍然沒有運氣,謝謝噸雖然!仍然使用「'PFUser類必須在使用Parse之前向registerSubclass註冊」。任何其他想法? – MQLN