Common files in the iOS Development UI Chapter 15-Project

Source: Internet
Author: User
Tags uikit

IOS Development UI article - Introduction to common project documents

I. Structure of the project document

Ii. Introduction of documents

1.products folder : mainly used for mac a computer-developed executable file, iOS This file is not available for development

2.frameworks folders are primarily used to place dependent frames

3.test folders are used to do unit tests.

4. Common folders ( Project name folder )

( 1 ) xxxinfo.plist file (in this project, the 01- Common Files -info.plist )

1 ) Simple Description

Is the configuration file, the file for the project to do some run-time configuration, very important, cannot be deleted.

in older versions Xcode in the project created, the name of this configuration file is called Info.plist .

Note: So in loading your own prepared plist file, do not use the Info name.

2 description of the properties of the configuration file:

Bundledisplay Name:

The application display name. If you want to modify the file name displayed on your desktop, just modify it here. (You need to delete the original program first and then clear the project, because the program has a cache)

Bundleidentifer:

Unique identifier (uniquely identifies an application, in order to ensure the uniqueness of the program, usually the domain name upside down)

Bundle versions string, short and the bundleversions

Two are used to represent the version of the application, the previous version is the official version, and the later is the build, which is the internal version developed by the company. Note : when uploading an app , the later version must be larger than the previous version.

Mainstoryboard File Base Name

The most important Storyboard

There are two ways of modifying plist configuration file:

The first way is to modify the configuration information in the interface.

The second way to directly click on the project, can be set through the visual interface.

Additional notes:

A. the rotation direction that the application supports. Four directions, vertical - not supported upside down- left - right (up to three directions only)

b.plist after the file is opened XML file. As with dictionaries, data is saved in the form of key-value pairs. In the XML file, a CF prefix has been added

(2)pch file ( 01- common file in this project -prefix.pch )

1 ) Simple Description

The saved content can be shared by all other original files in the project.

usually the processing of macro files needs to be added Import Import the header file. You can later define this macro in this file, no longer need to import the header file

2 ) Application Scenario:

1. used to define some global macros,

2. used to import some global can use the header file.

3. Use to customize the NSlog, it consumes resources. (almost the most consumed), remove all prints at the time of release.

(Supplement: In development, it is divided into two stages.)

first, the development of debugging phase, need to print Log Debug Program, if the program is in the debugging phase, the system will define a name for us called DEBUG the macro.

The second is the release phase: no printing required Log , because Log very resource-intensive, and the user can not understand Log , this macro is removed if the program processes the release phase.

do you want to make a release NSlog all commented out ? then in the second edition, the third version of the time, but also to put all the comments off NSlog all open?

for this issue, in . PCH Customization in Files NSlog can be a good solution. )

3 ) Custom NSlog

You can open it when you're doing the development. PCH file to see if there are any customizations in the company NSlog .

#import <Availability.h>

#ifndef __IPHONE_5_0

#warning "This project Usesfeatures only available in IOS SDK 5.0 and later."

#endif

/************__objc__begin************/

All content in the. m file or. mm

#ifdef __objc__

#import <UIKit/UIKit.h>

#import <Foundation/Foundation.h>

#import "TXPerson.h"

#ifdef DEBUG //Commissioning Phase

#define TXLOG (...) NSLog (__va_args__)

#else //Release phase

#define TXLOG (...)

#endif

#define ABC Ten

#endif

/************__objc__end************/

/**

* Outside of everything, the whole project is shared

*/

#define Name Ten

/**

PCH file is useful:

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

*/

Description: ... means to receive mutable parameters

Add:

_objc_ this macro, in all the . M and the . MM in the file , contains the macro by default, the following two sentences are compiled by default

Conditional compilation statement, and if you have this macro, compile the following statement.

#import <UIKit/UIKit.h>

#import <Foundation/Foundation.h>

if this global header file or macro, just . M or . MM file, please write the file or macro to #ifdef_ODBC_ Used .

watch out. : It is recommended to write in conditional compilation (note #endif )

infoplist.strings the file, with Info.plist localization related to files

Common files in the iOS Development UI Chapter 15-Project

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.