Build HelloWorld for iOS basic 01, analyze and test the real machine, ioshelloworld

Source: Internet
Author: User

Build HelloWorld for iOS basic 01, analyze and test the real machine, ioshelloworld
Build HelloWorld for iOS basic 01, analyze and test the real machine

 

Preface:

Exporting HelloWorld from the console is the first step in learning various languages and a very important step in our life.

After many years, I hope we can continue to learn more things in the world with HelloWorld.

 

This article uses HelloWorld as the starting point to introduce iOS applications and how to use Xcode to create iOS applications.

 

Directory:

1. Create a HelloWorld Project

1.1. Design Interface

1.2. Real machine testing

2. iOS Project template in Xcode

2.1. Application Type

2.2. Framework & Library type

2.3. Other type

3. Application Analysis

4. Finally, I will pull another example.

 

 

 

1. Create a HelloWorld Project

Start Xcode, click the File-New-Project menu, or directly click "Create a new Xcode project ":

OptionDescriptionProject NameThe name of the project.Organization NameThe name of the company or organization.Organization Identifier

The identifier of a company or organization (important ).

Generally, the domain name of a company or organization (such as com. geeksss) is entered here ). Similar to the package name in Java.

Bundle Identifier

Bundle identifier (important ). This Identifier is composed of Project Name + Organization Identifier.

Because it is used when an application is published on the App Store, its name cannot be repeated.

Language

Select a development language.

Here you can select the language used for application development. In Xcode 6, you can select Swift and Objective-C.

Devices

Select a device. You can build an iPhone or iPad-based project or a general project.

A general project is a project that works properly on the iPhone and iPad.

 

After setting related project options, click Next and select the location for storing the project files as prompted:

 

However, when we open the application, the system prompts that the application comes from untrusted developers, and the application is limited to open.

After all, I have not purchased a developer certificate .. Haha:

2.1. Application Type

Most of our development work starts from using the Application template to create iOS programs. This type includes five templates as follows:

Template Name Template Introduction
Master-Detail Application You can build a tree-like navigation mode application. The generated code includes the navigation controller and table View Controller.
Game You can build iOS-based game applications.
Page-Based Application You can build applications similar to the e-book effect, which is a tile navigation.
Single View Application You can build a simple single view application.
Tabved Application You can build an application in the tag navigation mode. The generated code includes the tag controller and tag bar.

 

 

 

2.2. Framework & Library type

Famework & Library templates, which can be used to build applications based on Cocoa Touch Framework and Cocoa Touch Static Library:

 

Cocoa Touch Framework allows developers to customize the Framework applied to UIKit, while Cocoa Touch Static Library allows developers to create Static libraries based on the Framework.

Due to code security and code reuse for multiple projects, we can write some classes or functions into static libraries.

The static library cannot run independently. Upon successful compilation, a file named libXXX. a is generated (for example, libHelloWorld. ).

 

 

 

2.3. Other type

With this type, we can build In-App Purchase Content and empty projects.

Using the in-APP purchase content package can help us build applications with built-in charging functions:

 

When HelloWorld is started, the application: didfinishlaunchingwitexceptions method of the circle will be called first. We will introduce other methods in detail later.

 

In the project navigation view, we can see the Images. xcassets file, which can be used to place project Images.

The Supporting Files group has only one Info. plist file, which is a project property description file and stores the property settings of the project.

The Products Group is the product package for the vehicle generation function of the project.

 

Note:

When accessing resource files, folders and groups are different. when accessing resources in folders, you must use folders as the path.

If the icon.png file is placed in the image folder, the path to the file is "image/icon.png?#if the image is a group, then the actual path is" icon.png ".

 

 

 

4. Finally, I will pull another example.

I always think it's hard to look at the end...

 

If this article is helpful to you, do not forget to stamp the thumb in the lower right corner.

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.