Development of iPhone APP structure based on XCode

Source: Internet
Author: User

Based onXCodeDevelopmentIPhone APPThe program structure tutorial is described in this article. The following analysis is based onXcodeCode for iphone development. PassXcodeIDE can do a lot of things automatically during design, but what do these things mean?APP. After analysis, you can understand the general structure and operating mechanism of the application. Based on this, you only need to understand the use of specific controls or function libraries.

IPhone program structure

All iphone applications are desktop windows. In terms of visibility, everything you see is windows, because they all inherit from the common basic class UIControl:

Each Iphone program has a main window;

Each displayed sub-window is also a window;

Each control is a subwindow.

For example:

For a single view program, the main window contains sub-windows;

For multi-window programs,

The main view contains a special sub-window: Multi-Window controller.

Multiple windows controllers include each sub-Window

Therefore, there is a parent-child relationship between Windows:

One main window can only contain one subwindow

This sub-window can be a specific sub-window; this is a single window Program

This sub-window is a multi-window Controller; this is a multi-window Program

A child window may contain multiple controls, and these controls are also child windows.

A multi-window controller is also a sub-window. It manages sub-windows as one control.

By understanding the above logical organizational structure, you can see how the file is physically represented.

Physical organization of the IPhone Program

Sub-Window

Each sub-window consists of two parts: resource files and control files. They are described as follows:

Obviously, the operation is very troublesome, and it is not as good as the automatic one-step installation in MFC. Moreover, the corresponding types of each type of control cannot be automatically prompted.
 
MVC hierarchy

V-view layer
 
C-control layer

Comparison of MFC

Resource file rc
 
Ing Class
 
The difference with MFC is:

Xlb includes both resource information and control and member object ing information.

In MFC, the control and member ing information is placed in the corresponding class.

It can be seen that the sub-window has two functions: interface and control; control is responsible for managing the sub-window control objects and their messages.

Main Window

The main window has two functions: interface and control.

The interface is implemented through the xlb resource file, but the interface is very simple, but it is only responsible for which sub-window to store. The fixed file name is MainWindow. xlb.

There is no separate control file. Because the function is very simple, it is only responsible for the child window, so it can be implemented through the UIApp interface. That is, the proxy class of an APP. The name of the proxy class is "projectname" AppDelegate.

Applications

Each application has some other fixed files:

Main. m Application Start File

Configuration information of the Info. plist application, such as the sample tag.

After learning about the organizational structure of the above file, an example can be analyzed to quickly understand the general framework, where each function is dependent. You can also understand the significance of generating code behind Xcode interaction.

IPhone Lifecycle

A multi-window program appears multiple sub-Windows, while a multi-window controller is a limited number provided by the Iphone.

Iphone development Reference System

Interface layout Control

Mainly special controls and special event responses

Persistent Layer

Application Deployment and access limitations on the Iphone

Plotting

Personal Understanding

A view is similar to a control in a window (for example, a dialog box). You can add some response events and have two file objects:. h and. m.

File's Owner is similar to the window class wizard, used to add Response Processing, and simultaneously operate. h and. m Files

Summary: Based onXCodeDevelopmentIPhone APPThe content of the program structure tutorial is complete. I hope this article will help you!

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.