{"id":8338,"date":"2014-01-21T14:23:13","date_gmt":"2014-01-21T19:23:13","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=8338"},"modified":"2014-01-21T14:36:11","modified_gmt":"2014-01-21T19:36:11","slug":"common-init-method-name","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/01\/21\/common-init-method-name\/","title":{"rendered":"Common Init Method Name"},"content":{"rendered":"<p><a href=\"https:\/\/twitter.com\/marcoarment\/status\/420270274278608896\">Marco Arment<\/a> asks what to name a method that factors out shared code, so it can be called from multiple initializers. <a href=\"https:\/\/twitter.com\/marcoarment\/status\/420275804715909121\">The results<\/a> seem to indicate that there is no agreed upon standard. Apple seems to use <code>-commonInit<\/code>, but when subclasses are involved it&rsquo;s probably better to use a name like <code>-commonInitFor<em>Class<\/em><\/code>. I lean toward <code>-setUp<em>Class<\/em><\/code>, which is shorter and more verby.<\/p>","protected":false},"excerpt":{"rendered":"<p>Marco Arment asks what to name a method that factors out shared code, so it can be called from multiple initializers. The results seem to indicate that there is no agreed upon standard. Apple seems to use -commonInit, but when subclasses are involved it&rsquo;s probably better to use a name like -commonInitForClass. I lean toward [&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":[69,54,71],"class_list":["post-8338","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-objective-c","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8338","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=8338"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8338\/revisions"}],"predecessor-version":[{"id":8340,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8338\/revisions\/8340"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=8338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=8338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=8338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}