Why is #ifdef debug in iOS executed before didfinishlaunchingwithoptions

Source: Internet
Author: User

#ifdef DEBUG
... Program Section 1 ...
#else
... Program Section 2 ...
#endif

This indicates that if the identifier debug has been defined by the # define command, the program Segment 1 is compiled, otherwise the program segment 2 is compiled. The #ifdef means if define (if it has a # define). The same #ifndef means that if not define (if there is no # define), it is contrary to #ifdef's meaning.

And where is debug defined?

There is a "debug=1" in "Target > Build Settings > Preprocessor Macros > Debug".

When you run, Test, analyze, it belongs to debug mode, when profile, archive is the release mode. See "Edit Scheme ..." in your iOS project

Because #ifdef Debug is done at compile time, it is compiled before appdelegate execution begins, so it executes before Didfinishlaunchingwithoptions executes.

Why is #ifdef debug in iOS executed before didfinishlaunchingwithoptions

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.