6

When asking questions on SO that involve Xcode code-snippets, the syntax is to use a #, which makes the code look like it's inside a comment. For example this Xcode standard snippet for looping through an array of objects:

for (<#type *object#> in <#collection#>) {
        <#statements#>
    }

or this custom-made snippet:

UILabel *<#labelName#> = [[UILabel alloc] initWithFrame:CGRectMake(<#x#>, <#y#>,<#width#>, <#height#>)];

On Stack Overflow all code after the first # will look like its commented out. An example on this bug is shown in this question I have asked on SO about code snippets. More on Xcode snippets here

2

1 Answer 1

5

This is a limitation of the Objective C highlighter.

If it bothers you, you can turn it off using special HTML comments - I've done this for the example you posted.

2
  • Would it be possible for the community to submit a patch to said highlighter, and get that implemented on SO? Commented Mar 27, 2013 at 18:30
  • If you get it into Prettify, it should eventually end up on SO.
    – Shog9 StaffMod
    Commented Mar 27, 2013 at 18:37

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.