When programing using XCode, we can use some macros or tags to assist the navigation of code. Some of them are listed as bellow.
Syntax:
#pragma mark arguments
, where arguments can be - or other characters.
Example:
#pragma mark - #pragma mark Methods for view controller #pragma mark - Methods for data sourcewould cause XCode to generate the following navigation items:
Syntax:
#warning message, where message can be any characters.
Usage:
#warning is used to customize warning in an application.
#warning also finds its use in marking TODO and FIXME. I'd prefer to use #warning rather than TODO and FIXME when coding. After all warnings are resolved I feel assured that all features are implemented and issues are fixed.
Syntax:
#error message
Usage:
#error is used to customize error in a application.
How it can be used is to be researched.
Syntax:
// TODO: message, where message can be any characters.
Usage:
One example use of // TODO: is to mark postponed implementation of a function so that it's easy to find what's left to do. We do this when constructing framework or building workflow of an application.
Caveats:
Only when // TODO is used outside member function can the message be listed in the navigation item list.
Syntax:
// FIXME: message
Usage:
One example use of // TODO: is to mark issues to be fixed. Reasons of that the issue may not be fixed by now can vary a lot. It can be caused by an interruption, or incompetent dependency, or other.
Caveats:
Only when //FIXME is used outside member function can the message be listed in the navigation item list.
P.S. For further information, please refer to Xcode and #pragma mark and Xcode FIXME and TODO