Xcode and #pragma mark - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Wednesday, April 18, 2012

Xcode and #pragma mark

I've started using #pragma mark directives in my code to help with organization as my implementation files grow. #pragma mark is simple to use, for example, insert the following to call out initialization code:

 1 2 
  #pragma mark - #pragma mark Initialization
Once this is in place, the Functions Menu (in the navigation bar) which shows a list of locations within a source file (e.g. definitions of classes, functions and methods) will display a new marker with the label "Initialization." The code in line 1 will add a line separator inside the Functions Menu, in this example, with the line appearing above the "Initialization" marker.

No comments:

Post a Comment