What does this mean when programming iphone?

#pragma mark Internal API 

I saw this in a book called xcode_quick_tour_iphoneOS.

Does anyone know about this?

+6
objective-c iphone xcode
source share
3 answers

The #pragma is a special preprocessor directive that allows the C preprocessor to create largely portable extensions. Basically, when another preprocessor sees a pragma directive that he does not understand, he should ignore it.

In this case, #pragma mark intended to help with the documentation. When you add these lines to the source file, Xcode breaks your source code in its drop-down menu, which you can use to go to certain areas of your code (for example, defining functions or defining constants). If you add #pragma mark - , Xcode will add a horizontal separator to the drop-down menu.

+18
source share

This directive is used to specify various parameters for the compiler. These parameters are specific to the platform and the compiler you are using. See your compilerโ€™s manual or link for more information on possible options that you can define with #pragma.

If the compiler does not support a specific argument for #pragma, it is ignored - no error is generated.

See: http://www.cplusplus.com/doc/tutorial/preprocessor/ for an explanation of preprocessor directives

0
source share

Apple has an internal API that is not intended for use by application developers, so these pragmas will โ€œhideโ€ the API from the developer docs

-one
source share

All Articles