{"id":4448,"date":"2014-03-30T11:07:44","date_gmt":"2014-03-30T11:07:44","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/ios-background-download-completes-but-the-view-has-been-destroyed-collection-of-common-programming-errors\/"},"modified":"2014-03-30T11:07:44","modified_gmt":"2014-03-30T11:07:44","slug":"ios-background-download-completes-but-the-view-has-been-destroyed-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/ios-background-download-completes-but-the-view-has-been-destroyed-collection-of-common-programming-errors\/","title":{"rendered":"ios background download completes but the view has been destroyed-Collection of common programming errors"},"content":{"rendered":"<p>I would like to use AFNetworking to perform periodical JSON requests to my server (updating the user&#8217;s profile and checking for changes).<\/p>\n<p>What if the background job is running but the user pushed the &#8220;Back&#8221; button or anything that makes the ViewController to be destroyed? How can I manage this? I mean, in that case I would like to ignore the result and perform it again when the user returns to the View<\/p>\n<p>Thank you<\/p>\n<p>PS: I don&#8217;t want a full working code. I just would like to know how can I know, from a background download job (ran using AFNetworking) if the ViewController has been destroyed or not.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I would like to use AFNetworking to perform periodical JSON requests to my server (updating the user&#8217;s profile and checking for changes). What if the background job is running but the user pushed the &#8220;Back&#8221; button or anything that makes the ViewController to be destroyed? How can I manage this? I mean, in that case [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4448","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4448"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4448\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}