ios - Swift project crashing with Thread 1: EXC_BAD_ACCESS (code = 1, address = 0x0) -


i have been searching on solution problem. looks bad memory access, trying access object not exist. tried using nszombie see if came up, far tell nothing did. crashing @ declaration app delegate.

appdelegate.swift

@uiapplicationmain class appdelegate: uiresponder, uiapplicationdelegate { var window: uiwindow?   func application(application: uiapplication!, didfinishlaunchingwithoptions launchoptions: nsdictionary!) -> bool {     // override point customization after app launches     parse.setapplicationid("removed on purpose", clientkey: "removed on purpose")     pfanalytics.trackappopenedwithlaunchoptions(launchoptions)     pffacebookutils.initializefacebook()      return true }  func application(application: uiapplication!, openurl url: nsurl, sourceapplication: string, annotation: anyobject?) -> bool {     return fbappcall.handleopenurl(url, sourceapplication: sourceapplication, withsession: pffacebookutils.session())  }  func applicationdidbecomeactive(application: uiapplication!) {     fbappcall.handledidbecomeactivewithsession(pffacebookutils.session()) }  func applicationwillresignactive(application: uiapplication!) {     // sent when application move active inactive state. can occur types of temporary interruptions (such incoming phone call or sms message) or when user quits application , begins transition background state.     // use method pause ongoing tasks, disable timers, , throttle down opengl es frame rates. games should use method pause game. }  func applicationdidenterbackground(application: uiapplication!) {     // use method release shared resources, save user data, invalidate timers, , store enough application state information restore application current state in case terminated later.     // if application supports background execution, method called instead of applicationwillterminate: when user quits.  }  func applicationwillenterforeground(application: uiapplication!) {     // called part of transition background inactive state; here can undo many of changes made on entering background. }  func applicationwillterminate(application: uiapplication!) {     // called when application terminate. save data if appropriate. see applicationdidenterbackground:. }   } 

dashboardviewcontroller.swift

import uikit  class dashboardviewcontroller: uiviewcontroller { override func viewdidload() {     super.viewdidload()     // additional setup after loading view }  override func didreceivememorywarning() {     super.didreceivememorywarning()     // dispose of resources can recreated }  } 

using breakpoints have determined not getting past class declaration app delegate. tried checking of classes in main.storyboard file make sure linked properly, again far can tell is. appreciate more ideas on how fix this!! thanks!

edit: solved problem , code has been fixed. can else if having similar problem!

i ran same issue today. of xcode 6 beta 6 auto complete suggests:

func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject : anyobject]) -> bool {} 

this crashes @ startup exc_bad_access , blank screen.

as ! added last argument, works fine:

func application(application: uiapplication,didfinishlaunchingwithoptions launchoptions: [nsobject : anyobject]!) -> bool {} 

in current documentation ! missing well:

optional func application(_ application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject : anyobject]) -> bool 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -