[Basic iOS control and basic ios Control

Source: Internet
Author: User

[Basic iOS control and basic ios Control
A. Common files in the project1. unit test Test1 # define A 12 # define B 2 B. global import # import

1 # import "myhead. h"
C. Only allow the. m Files in all OC projects to import the foundation and UIKit LibrariesPrevent introduction of errors in other languages (such as C)
1 # ifdef _ OBJC__2 3 # import <Foundation/Foundation. h> 4 # import <UIKit/UIKit. h> 5 6 # endif
D. debug NSLog OptimizationThe system configures a DEBUG Macro during debugging.
1 # ifdef _ OBJC _ 2 3 # import <Foundation/Foundation. h> 4 # import <UIKit/UIKit. h> 5 6 # ifdef DEBUG 7 # define MyNSLog (...) NSLog (_ VA_ARGS _) 8 # else 9 # define MyNSLog (...) 10 # endif11 12 # endif
Note that "_ VA_ARGS _" is followed by two underscores. Use the MyNSLog function to print the test information. After the app completes the release version, MyNSLog will automatically fail.
1 MyNSLog (@ "test % d-% d", A, B );
Out: 13:22:33. 888 DatePicker [20702: 1696549] Test 1-2

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.