Some favorite site feeds aggregated locally: iPhone Development RSS   Adobe Labs RSS   Macrumors RSS

Wednesday, April 1, 2009

#pragma mark in Xcode - learn to love it!

Wednesday, April 1, 2009   

Update: Thanks to Twitter and 0xced, I found out that //MARK: - and //MARK: Whatever works as well, and is a whole lot more portable.

I wondered what that '#pragma mark' (twitter link) actually did in Xcode. View the two samples below for a quick introduction.



That menu that allows you to jump around within your code can be modified a bit, allowing you to group your items either by means of a separator by using "#pragma mark -" or by using a title by using "#pragma mark <whatever>". That's a very useful bit of information, especially when you start getting into long bits of code in the same class file.

I love it. I wish Xcode would also list the methods in alphabetical order in that menu by block, but the #pragma mark stuff really does help a lot.
 
 Return to the main page
Comments:

There are currently 0 Comments:

 Leave a comment