{"id":2776,"date":"2010-09-24T21:38:12","date_gmt":"2010-09-25T01:38:12","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=2776"},"modified":"2010-09-24T21:38:16","modified_gmt":"2010-09-25T01:38:16","slug":"dealloc","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2010\/09\/24\/dealloc\/","title":{"rendered":"-dealloc"},"content":{"rendered":"<p><a href=\"http:\/\/iphonedevelopment.blogspot.com\/2010\/09\/dealloc.html\">Jeff LaMarche<\/a> and <a href=\"http:\/\/www.red-sweater.com\/blog\/1423\/dont-coddle-your-code\">Daniel Jalkut<\/a> discuss whether to set Objective-C ivars to <code>nil<\/code> in your <code>-dealloc<\/code> methods. <a href=\"http:\/\/iphonedevelopment.blogspot.com\/2010\/09\/more-on-dealloc.html\">LaMarche responds<\/a>. Assuming reasonable quality code, I&rsquo;m not sure that it makes a huge difference either way, though I tend to lean towards Jalkut&rsquo;s &ldquo;don&rsquo;t mask symptoms&rdquo; camp. <a href=\"http:\/\/www.red-sweater.com\/blog\/1423\/dont-coddle-your-code#comment-153983\">Jeff Johnson<\/a> makes an interesting point in a comment:\n<\/p>\n<blockquote cite=\"http:\/\/www.red-sweater.com\/blog\/1423\/dont-coddle-your-code#comment-153983\"><p>As Mac developers who distribute via the internet, we can get a crash report (from a user, not from Apple, grr!), find the bug, fix the crash, and release a software update all within an hour. Thus, we tend to favor not &lsquo;coddling&rsquo; our code, as Daniel puts it. iOS developers, on the other hand, are hostages to the app store approval process. Of course, if your iOS app is crashing in production, one wonders how it got through the approval process in the first place or what the point is of the process, but in any case, your coding precautions may be different for that case.<\/p><\/blockquote>\n<p>This sounds like an argument for using macros so that you can easily change your decision based on how you are testing or deploying the code.<\/p>","protected":false},"excerpt":{"rendered":"<p>Jeff LaMarche and Daniel Jalkut discuss whether to set Objective-C ivars to nil in your -dealloc methods. LaMarche responds. Assuming reasonable quality code, I&rsquo;m not sure that it makes a huge difference either way, though I tend to lean towards Jalkut&rsquo;s &ldquo;don&rsquo;t mask symptoms&rdquo; camp. Jeff Johnson makes an interesting point in a comment: As [&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":[],"class_list":["post-2776","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/2776","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=2776"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/2776\/revisions"}],"predecessor-version":[{"id":2777,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/2776\/revisions\/2777"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=2776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=2776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=2776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}