Xcode 4 tip (#pragma mark)

So probably everyone but me already knew this, but I used to always do:


#pragma mark -
#pragma mark UITableViewDelegate Methods

so I’d have a line plus the title of the section in the functions menu (from the jump bar now) like this:

    -------------------------------
    UITableViewDelegate

 

I just accidentally discovered that you can do:

     #pragma mark - MyDelegate Methods

to get the same thing, or you can put the “-” at the end to get it the opposite way:

     #pragma mark MyDelegate Methods -

gives:

    UITableViewDelegate
    -------------------------------

You can even put two “-“s in there, one at either end to get lines above and below your section name:

#pragma mark - MyDelegate Methods -

for:

    -------------------------------
    UITableViewDelegate
    -------------------------------
Thanks Xcode team!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: