{"id":8238,"date":"2013-11-22T14:18:39","date_gmt":"2013-11-22T19:18:39","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=8238"},"modified":"2013-11-22T14:24:34","modified_gmt":"2013-11-22T19:24:34","slug":"iboutlets-as-weak-references","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2013\/11\/22\/iboutlets-as-weak-references\/","title":{"rendered":"IBOutlets as Weak References"},"content":{"rendered":"<p><a href=\"http:\/\/openradar.appspot.com\/radar?id=5907704967069696\">Zach Drayer<\/a>:<\/p>\n<blockquote cite=\"http:\/\/openradar.appspot.com\/radar?id=5907704967069696\"><p>When using Interface Builder and code, you have IBOutlets. If your project is ARC, the IBOutlets generated are `weak`. This is problematic because if you turn on CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK and CLANG_WARN_OBJC_RECEIVER_WEAK to try and catch bugs, you run into dozens\/hundreds\/thousands of warnings in your project. While it is nice to have your code as correct as possible, seeing thousands of warnings is enough to greatly sadden pretty much anyone.<\/p><\/blockquote>\n<p>The compiler wants you to make a strong reference before each use, which is not really necessary if you know that the owner of the references isn&rsquo;t going anywhere.<\/p>","protected":false},"excerpt":{"rendered":"<p>Zach Drayer: When using Interface Builder and code, you have IBOutlets. If your project is ARC, the IBOutlets generated are `weak`. This is problematic because if you turn on CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK and CLANG_WARN_OBJC_RECEIVER_WEAK to try and catch bugs, you run into dozens\/hundreds\/thousands of warnings in your project. While it is nice to have your code 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":[55,230,69,31,30,54,71],"class_list":["post-8238","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-arc","tag-clang","tag-cocoa","tag-ios","tag-mac","tag-objective-c","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8238","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=8238"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8238\/revisions"}],"predecessor-version":[{"id":8239,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8238\/revisions\/8239"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=8238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=8238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=8238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}