ios - grand central dispatch, operation queues, async, view will and did disappear -


hopefully these questions seem helpful people out there. i've been learning objective c, mostly book, found amazing , helpful noob. questions have deal this:

what happens queue when user changes view? can't seem find explanation anywhere.

from understanding, using nsoperation , queue, can cancel using "cancel"...but if don't want cancel? if, user selects multiple images upload server, , create queue order, , user switches new view controller? might time consuming, on slow mobile network. remember reading somewhere ios gives around 20 seconds time method finish work, think that's when app enters background.

for gcd, there no cancel method...so happens in background if use async? guess if don't have response queue, mean don't update ui in way, shouldn't queue finish since it's sent thread?

i'm sure there more don't understand far threading goes, hope made question clear. , please please don't tell me use afnetworking stuff...i tried using keychain wrappers out there , failed. book, straight apple code book did easily. rather learn basics first before using easier way out.

i appreciate if took time talk this. in advance!

your concern having set amount of time finish tasks applies when switch away app app. , in case can use beginbackgroundtaskwithexpirationhandler method app can request time finish tasks if app happens go background. see executing finite-length task in background section of app states , multitasking section of ios app programming guide more information.

but if you're still within app (whether transitioned view controller or not), you've added operation queue continue run until cancel operations (or app suspended or terminated). likewise, you've added gcd queues continue run until app suspended or terminated.

in both of these scenarios, above beginbackgroundtaskwithexpirationhandler give few minutes finish queued tasks/operations after app goes background.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -