ios - Parse/FaceBookSDK crash with Swift -


i need bad.

i've been programming swift while here, can't seem find had problem before.

let me describe problem: whenever try run app, crashes in appdelegate, right on first line "sigabrt". council says "'the class pfuser must registered registersubclass before using parse.'", has me @ loss since haven't subclassed remotely touching pfuser.

i assume it's facebooksdk (4.something, newest of july 2) i've been trying integrate, when remove project things remain broken. have how updated parse 1.7.5, don't know anymore.

here's i've tried

  1. cleaning, rebuilding, restarting, etc.
  2. importing parse "import parse" within app delegate, instead of using header bridge.
  3. reinstalling frameworks, multiple times.
  4. changing order of things within didfinishlaunchingwithoptions

here's code:

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  // buttons , 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) }    

}

and here's header:

#import <parse/parse.h> #import <parsefacebookutilsv4/pffacebookutils.h> #import <bolts/bolts.h>  #import <googlemaps/googlemaps.h>  #import <fbsdkcorekit/fbsdkcorekit.h> #import <fbsdkloginkit/fbsdkloginkit.h> 

any amazing!

thanks,

-maclean

with newest sdks, in experience don't need bridging headers, , adding sdks there cause issues! try removing them header , using imports in class you're using them in.

import parse import fbsdkcorekit import fbsdkloginkit 

Comments