{"id":5739,"date":"2012-08-18T21:14:02","date_gmt":"2012-08-19T02:14:02","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=5739"},"modified":"2016-06-02T12:00:48","modified_gmt":"2016-06-02T16:00:48","slug":"zombies-and-arc","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2012\/08\/18\/zombies-and-arc\/","title":{"rendered":"Zombies and ARC"},"content":{"rendered":"<p><a href=\"http:\/\/developer.apple.com\/library\/mac\/qa\/qa1758\/_index.html\">Apple QA1758<\/a>:<\/p>\r\n<blockquote cite=\"http:\/\/developer.apple.com\/library\/mac\/qa\/qa1758\/_index.html\"><p>Prior to iOS 6 \/ OS X 10.8, using the <a href=\"https:\/\/developer.apple.com\/library\/ios\/recipes\/instruments_help-memory-allocations-help\/Eliminating_Messages_To_Deallocated_Objects\/06_Eliminating_Messages_To_Deallocated_Objects.html\">the Zombies instrument<\/a> or <a href=\"https:\/\/developer.apple.com\/library\/ios\/technotes\/tn2239\/_index.html#\/\/apple_ref\/doc\/uid\/DTS40010638-CH1-SUBSUBSECTION23\">NSZombieEnabled<\/a> or the \"Enable Zombie Objects\" <a href=\"https:\/\/developer.apple.com\/library\/ios\/recipes\/xcode_help-scheme_editor\/Articles\/SchemeDiagnostics.html\">Xcode diagnostic<\/a>, prevented ARC from &ldquo;cleaning up&rdquo; instance variables at deallocation-time. Your <code>-dealloc<\/code> methods would still be run, however any instance variables that you didn&rsquo;t explicitly set to <code>nil<\/code> would be untouched. If an instance variable strongly referenced an object, then that object would be kept alive forever by the abandoned instance variable.<\/p><\/blockquote>\r\n<p>Via <a href=\"http:\/\/0xced.blogspot.com\/2012\/08\/debugging-with-arc-and-zombies-enabled.html\">C&eacute;dric Luthi<\/a>, who offers a workaround.<\/p>","protected":false},"excerpt":{"rendered":"<p>Apple QA1758: Prior to iOS 6 \/ OS X 10.8, using the the Zombies instrument or NSZombieEnabled or the \"Enable Zombie Objects\" Xcode diagnostic, prevented ARC from &ldquo;cleaning up&rdquo; instance variables at deallocation-time. Your -dealloc methods would still be run, however any instance variables that you didn&rsquo;t explicitly set to nil would be untouched. If [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[55,56,54],"class_list":["post-5739","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-arc","tag-debugging","tag-objective-c"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/5739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=5739"}],"version-history":[{"count":5,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/5739\/revisions"}],"predecessor-version":[{"id":14721,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/5739\/revisions\/14721"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=5739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=5739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=5739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}