{"id":295,"date":"2008-10-16T22:38:48","date_gmt":"2008-10-16T21:38:48","guid":{"rendered":"http:\/\/www.malcolmhardie.com\/weblogs\/angus\/?p=295"},"modified":"2025-02-01T03:04:15","modified_gmt":"2025-02-01T03:04:15","slug":"xcode-function-popup","status":"publish","type":"post","link":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/2008\/10\/16\/xcode-function-popup\/","title":{"rendered":"XCode function popup"},"content":{"rendered":"<p>I love the XCode function popup, particularly in Objective C, because I can add <strong>#pragma mark<\/strong> comments to divide up the list.<\/p>\n<p>Unfortunately languages that aren&#8217;t C derived don&#8217;t offer <strong>#pragma<\/strong>, so I missed these little dividers<\/p>\n<p>Then I noticed that a comment that contained <strong>FIXME<\/strong> had appeared in the list too, looking just as if it were a #pragma mark entry<\/p>\n<p>Looking at the XCode documentation reveals that XCode will also search code comments for a range of keywords and use them to control entries in the function popup. And it will do this for  Java, Perl, Python, and Ruby (as well as the C based C, Objective-C and C++).<\/p>\n<p>This means I can write in other interesting languages and still get my function popup dividers.<\/p>\n<p>Just prefix the comment line with one of the following:<\/p>\n<ul class=\"nested\">\n<li class=\"nested li\"><code>MARK:<\/code><\/li>\n<li class=\"nested li\"><code>TODO:<\/code><\/li>\n<li class=\"nested li\"><code>FIXME:<\/code><\/li>\n<li class=\"nested li\"><code>!!!:<\/code><\/li>\n<li class=\"nested li\"><code>???<\/code><\/li>\n<\/ul>\n<p>and the remainder of that line will appear in the list.<\/p>\n<p>There is more in the <a href=\"http:\/\/developer.apple.com\/documentation\/developertools\/Conceptual\/XcodeWorkspace\/600-The_Text_Editor\/chapter_6_section_2.html#\/\/apple_ref\/doc\/uid\/TP40002679-SW10\">Apple Xcode tools documentation<\/a><\/p>\n<p>(It looks like there has been some discussion of this already (<a href=\"http:\/\/www.nabble.com\/pragma-mark-with-python-in-xcode--td18879370.html\">1<\/a>,<a href=\"http:\/\/www.tomonagatokuyama.com\/txt\/2008\/xcode-special-comment-keywords\/\">2<\/a>,<a href=\"http:\/\/tungchingkai.blogspot.com\/2008\/05\/xcode-workspace.html\">3<\/a>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I love the XCode function popup, particularly in Objective C, because I can add #pragma mark comments to divide up the list. Unfortunately languages that aren&#8217;t C derived don&#8217;t offer #pragma, so I missed these little dividers Then I noticed that a comment that contained FIXME had appeared in the list too, looking just as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[17,72],"class_list":["post-295","post","type-post","status-publish","format-standard","hentry","category-writing-software","tag-apple","tag-xcode"],"_links":{"self":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/comments?post=295"}],"version-history":[{"count":1,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts\/295\/revisions"}],"predecessor-version":[{"id":1423,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts\/295\/revisions\/1423"}],"wp:attachment":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/media?parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/categories?post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/tags?post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}