{"id":4874,"date":"2014-03-30T16:18:57","date_gmt":"2014-03-30T16:18:57","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/calling-objective-c-methods-collection-of-common-programming-errors\/"},"modified":"2014-03-30T16:18:57","modified_gmt":"2014-03-30T16:18:57","slug":"calling-objective-c-methods-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/calling-objective-c-methods-collection-of-common-programming-errors\/","title":{"rendered":"Calling Objective-C methods-Collection of common programming errors"},"content":{"rendered":"<p>The first sends a message to an object and so does the second. In almost all cases, you should use the first. It&#8217;s quicker and clearer. However, the second has its uses. For instance, you can use it in a situation where you would need to supply a call back.<\/p>\n<p>Another powerful use is in combination with NSSelectorFromString(). You can literally decide what message to use at run time based on a string in a configuration file or from user input (don&#8217;t forget to validate it!). You can even build selector names using NSString -stringWithFormat: etc. For instance, this parser kit uses the technique to inform the program when parser rules have been matched.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The first sends a message to an object and so does the second. In almost all cases, you should use the first. It&#8217;s quicker and clearer. However, the second has its uses. For instance, you can use it in a situation where you would need to supply a call back. Another powerful use is in [&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-4874","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4874","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=4874"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4874\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}