3

Does anyone know how to view comments in the method navigator in Xcode 4

In Xcode 3 these would put comments like:

???: Huh?
!!!: Woah
MARK: Aliens
TODO: Fix this

in here...

enter image description here

aaronium112
  • 2,992
  • 4
  • 35
  • 50
  • In Xcode 3, those kinds of comments and their display in the menu were defined in the file /Developer/Library/Private Frameworks/XcodeEdit.framework/Resources/BaseSupport.xclangspec (that's Xcode Language Specification). I don't know what the equivalent is in Xcode 4, which is why I'm not posting an answer, but I thought that tidbit may be useful to you in hunting this down; maybe you can figure out what the xclangspec equivalent is in v4. – jscs Apr 14 '11 at 07:01
  • 3
    I checked the apple developer forum. A bug report has been filed. Here's the response from Apple: "This is a follow up to Bug ID# 9159086. After further investigation it has been determined that this is a known issue, which is currently being investigated by engineering. This issue has been filed in our bug database under the original Bug ID# 7604687" – aaronium112 Apr 14 '11 at 14:12
  • Same problem here. I just could't find where to view those comments. – Di Wu Apr 25 '11 at 00:29
  • 2
    To be clear, these kinds of comments *will* appear in the function popup if they are outside any function/method body; inside functions/methods, they appear in Xcode 3 but not in Xcode 4. – SteveCaine Sep 27 '11 at 20:36

3 Answers3

3

You can still use // ???:, // FIXME: and // TODO: comments outside of methods to get the comment to pop up in the method navigator.

I know that some people would like these type of comments within methods to still show up in the method navigator and that there is a bug report filed against this, but I actually like this bug, as it forces me to keep my methods clean. I find that putting the // TODO:, etc., above the method creates better code readability.

Just my opinion.

rich.e
  • 3,660
  • 4
  • 28
  • 44
0

You can even to that in one line (comment and separator):

so instead of:

#pragma mark - 
#pragma mark MyCoolMethod

Just type as below:

#pragma mark - MyCoolMethod
- (void) myCoolMethod {
    //Code here...
}
Konrad77
  • 2,515
  • 1
  • 19
  • 36
-2

use the following:

#pragma mark your_comment_here

You can also use the following to add separator lines:

#pragma mark -
bsarrazin
  • 3,990
  • 2
  • 18
  • 31