In objective-C # What does Pragma mark mean?

Source: Internet
Author: User

In objective-C # What does Pragma mark mean?

The following code commands are often seen in the code in xcode ide:

The following code commands are often seen in the code in xcode ide:

# Pragma mark-
# Pragma mark Initialization

# What is Pragma?

Technically, code starting with # pragma is a compiler instruction, which is a program or compiler-specific instruction. They are not necessarily applicable to other compilers or other environments. If the compiler cannot recognize this instruction, it will ignore it.

Function

They tell the xcode compiler to separate the code from the function pop-up menu at the top of the editor pane, as shown in:

Some classes (especially some controller classes) may be long, and the method and function pop-up menu can facilitate code navigation. In this case, the # pragma command is added to organize the code logically.

Note:

1 # There cannot be spaces behind the "-" Of The Pragma mark.

2. If your logo does not appear in the pop-up menu, for example, there is no separator line, go to the xcode menu "preferences .. "in the" Code sense "option, deselect" Sort list alphabetically.

From: http://www.weste.net/2011/2-24/pragma-mark.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.