{"id":4801,"date":"2014-03-30T15:31:32","date_gmt":"2014-03-30T15:31:32","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/objective-c-c-static-method-performance-collection-of-common-programming-errors\/"},"modified":"2014-03-30T15:31:32","modified_gmt":"2014-03-30T15:31:32","slug":"objective-c-c-static-method-performance-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/objective-c-c-static-method-performance-collection-of-common-programming-errors\/","title":{"rendered":"Objective C \/ C static method performance-Collection of common programming errors"},"content":{"rendered":"<p>Here is a method from a class in some of Apple&#8217;s example code. Why is this method defined as a static C method rather than an Objective C class method or a class method? In the context in which it is used I suppose it needs to be as performant as possible. Is this why? Is this the most performant way to declare a method?<\/p>\n<pre><code>static BOOL lineIntersectsRect(MKMapPoint p0, MKMapPoint p1, MKMapRect r)\n{\n    \/\/Do stuff\n    return MKMapRectIntersectsRect(r, r2);\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is a method from a class in some of Apple&#8217;s example code. Why is this method defined as a static C method rather than an Objective C class method or a class method? In the context in which it is used I suppose it needs to be as performant as possible. Is this why? [&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-4801","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4801","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=4801"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4801\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}