我需要帮助如此糟糕。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