"Learning Summary" the role of Info.plist and PCH files

Source: Internet
Author: User

Info.plistAfter building a project, you will see a "info.plist" file under the supporting Files folder, which is very important for the project to do some run-time configuration, and cannot be deleted.

Other plist files in the project cannot have the word "Info" , or they will be mistaken for the "info.plist" that is very important.

There is also a infoplist.strings file in the project, which is related to the localization of the Info.plist file (the new version will not be created automatically, and the function of the infoplist.strings is summarized separately)

Common Properties (Note: If you open the Info.plist file with a text editor, the name and the changes from Xcode will be different)

Localiztion native development region-localization related
Bundle identifier-This is the only sign of the software, if there is the same software will conflict
Bundle name-Program is installed after the display name, limited to 10-12 characters, if exceeded, will be displayed abbreviated name
Bundle versions string, short and bundle version-This is the version number of the software, if the Update software, published to AppStore will strictly abide by the version number of the rules
Main Storyboard File Base name-This is the software's most important storyboard
Supported interface orientations-This is the direction of the software screen this is an array, the following three items are listed as follows:

Device Orientation
Portrait Vertical Screen
Upside down Upside down
Landscape left Sideways
Landscape Right Sideways

As long as this is checked, info.plist inside the supported interface orientations array will change

pch File

Apple officially removed the PCH from Xcode6, which can speed up compilation for trivial header file references
So, if you need a PCH file, you have to add it manually

1. Create PCH File

2. Configuration pch File-Build Settings-prefix Header

After you enter $ (srcroot)/xx.pch, compare the actual path to the configured path (note the true path of the PCH file, if it differs from the path )

3. The role of PCH files

1. Store some global macros (macros that are used throughout the project)
2. Used to include all header files (header files that are used throughout the project)
3. Can automatically turn on or off the log output function (custom nslog)

1 /** 2 * Debug phase, must have debug3 * Release phase, automatically delete debug4  *   5 * Determine if there is Debug. Smart Add Delete NSLog6  */  7 #ifdefDEBUG8 #defineCwllog (...) NSLog (__va_args__)9 #else  Ten #defineCwllog (...) One #endif  

4. Any object-c code that needs to be added to the

#ifdef __objc__   // all of the content in the. m file or. h file  is only available in #endif

"Learning Summary" the role of Info.plist and PCH files

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.