XCode function popup

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’t C derived don’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 if it were a #pragma mark entry

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++).

This means I can write in other interesting languages and still get my function popup dividers.

Just prefix the comment line with one of the following:

  • MARK:
  • TODO:
  • FIXME:
  • !!!:
  • ???

and the remainder of that line will appear in the list.

There is more in the Apple Xcode tools documentation

(It looks like there has been some discussion of this already (1,2,3)

This entry was posted in Writing Software and tagged , . Bookmark the permalink.

2 Responses to XCode function popup

  1. Pingback: Tip: Xcode function marks at Under The Bridge

Leave a Reply