ios - ViewController objects invalid when performFetchWithCompletionHandler called -


i received crash report tester main user object created masterviewcontroller (apparently) nil or invalid when os called performfetchwithcompletionhandler. know object initialized when app went background because don't request background fetch notifications unless i'm in state requires user object valid.

here snippet of create of masterviewcontroller:

class masterviewcontroller: uitableviewcontroller {  static var services = [service]() static var user:user! . . .  override func viewdidload() {     super.viewdidload()      // create model objects     masterviewcontroller.user = user()    .    .    .  } 

and here fetch call using user object:

func application(application: uiapplication, performfetchwithcompletionhandler completionhandler: (uibackgroundfetchresult) -> void) {      print("background notification: in performfetchwithcompletionhandler")      if masterviewcontroller.user.getproviderstate() == providerstate.offline ||         !userapimanager.sharedinstance.isloggedin {          print("replied .nodata")         completionhandler (.nodata)      } else {        .        .        .     } }   

the crash on line:

if masterviewcontroller.user.getproviderstate() == providerstate.offline ||         !userapimanager.sharedinstance.isloggedin  

the exception type i'm getting - exception type: sigtrap (this test program built in debug).

i have never seen error running in debugger while forcing app go background.

also, not freeing user object in didreceivememorywarning().

thanks insight might have.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -