iphone - DidEnterBackground - Keep waiting for an ASIHTTP request and parsing result -


maybe me find appropriate way handle :

  1. i have nstimer (started in appdelegate) fires class launch asynchronous server request (i use asiformdatarequest)
  2. when http json-response received, parse using touchjson
  3. then loop nsdictionary obtained fill dedicated nsmanagedobjectcontext
  4. then save context on user interactions

sometimes http request sent , user quit application. want time in order complete tasks 2 4 in background.

i read apple doc still not clear how gain time asynchronous action started ?

in short, how should use beginbackgroundtaskwithexpirationhandler ?

thanks usefull help.

kheraud

asihttprequest supports running requests in background:

[request setshouldcontinuewhenappentersbackground:yes]; 

if steps 2-4 inside delegate notifications , set above flag should want.

you won't able interact user once application has entered background though.


Comments