IOS development and learning 1: familiar with the cocoa environment and using xcode

Source: Internet
Author: User

The preparation for iOS development is a Mac host.

I come here step by step. It may be skipped many times.

I. Mac Basics

1. Check your current operating system. If you can upgrade your operating system, the system will be upgraded.

2. Many system settings are on the preference settings tab. It is mainly the input method. It can be the next sogou.

Click "system preference settings"> "language in text"> "Input Source" to select "American English" and "sogou" (similar to "win", but recently I found that my sogou input method is not very useful, after the switch, it is still in English .)

3. File disk operations

I believe that we are used to C, D, E, and F disks in windows. The disk under MAC is viewed in the finder. On the left side of the page, you can see a quick chart (which I understand ).

We need to check our personal documents (UNIX system habits are basically similar to Linux, because the original Ubuntu, partition mode is basically the same), root directory or something, in the finder, the command + shit + G or top menu bar has a path. Then you can drag the required directories to the left of the finder (so I call it a shortcut bar ).

4. File Installation

The basic installation files are stored in the application directory. After some programs are installed, you will be moved to the application directory.

5. File name duplication

This is also a common operation. In Mac, you can enter a new file name without selecting the right-click option.

For now, this is basic.

II. Development Environment Construction

Xcode and iossdk.

First of all, we cannot do this with the idea of Android development. I remember when I first set up the environment, it was always the next SDK, the next xcode IDE, and then the IB plug-in.

Later I found that the next xcode was available.

Xcode download has many methods, I am directly in the Developer Center: The first https://developer.apple.com/xcode/ is for free. Select view in MAC app store on the right.

Oh, by the way, you must apply for an Apple id.

In the App Store. (The advantage is that it is simple and convenient, but the disadvantage is that it is slow .)

After the above is done, I have been looking for an SDK !!!

Later, I found that SDK, IB, and so on have been integrated into xcode 4.3.2.

That is to say, in fact, our environment is set up in this way to complete the ios-sdk5.1 + xcode 4.x.

You don't have to worry about SDK or anything. I am the android development idea. I am always looking for a separate SDK and how to introduce it ..

After the above steps, we have completed a simple environment and can use xcode for development.

Iii. introduction and use of xcode4.3.2

Here, we need to consider some improvements and new features of ios5. a lot of information on the Internet is not correct during use.

1. For example, when you create an iOS Project New-> Project, enter the IOS application template. The previous version is said to have a base window. Now it's gone.

But it does not affect our creation. Which of the following are the choices for creating so many objects? Remember to never use the android mode. just create a project in one way,

Here is just a quick template creation.

2. Introduction of storyboards, which was not available in earlier versions. Newly Added ios5:

Storyboard

The new feature of iOS 5.

Http://blog.sina.com.cn/s/blog_59c8adb90100x4oh.html

For details, refer to the developer community of Apple or the blog above to understand the general situation.

3. New Features of Arc

Automatic reference counting

This is also newly added content of ios5, which is said to be quite similar to the automatic release of Java memory.

4. project code author and company comment

//

// Appdelegate. h

// Thi

//

// Created by Nono on 12-4-13.

// Copyright (c) 2012 nonowithlilith. All rights reserved.

//

This is the same as the comment at the beginning of each class in Java.

This can be set in the configuration file (you can check it online)

The simplest method I use here is:

Check whether there is an "Address Book" application under your system dock or find it in the finder application.

Click the edit option of your current user to add the company name.

Now, when you create a file, your username and the company name you set will be commented out.

5. the tangle of interface builder may be entangled at the beginning. Where is my IB plug-in?

In fact, you don't need to worry about it. It has already been integrated into xcode. The editing tool that pops up after you click the XIB file is the IB tool.

6. A brief introduction to the xcode tool interface:

It was absolutely tangled when I first came into contact with this tool. However, after we divide it by block, we are very clear. This is also a way to do a lot of things.

Bubble 1: This column does not know what to name for him. In general, it is similar to the shortcut toolbar. Start the run application on the left, select the simulator, and provide some intermediate prompts,

On the right side is the editing selection, and the view is the interface layout selection. The last organizer button is used for publishing the app.

Bubble 2: Engineering Explorer.

Bubble 3: editing area.

Bubble 4: It feels similar to the attribute area.

This is basically the case. Then we can look at the specific segments one by one.

7. Create an iOS project and the project structure.

This can be seen in bubble 2.

Thi is the name of the project I created and fill in various types of files.

Thitest. This folder is automatically generated after unit test is selected.

Frameworks: class library used by the project. There are only a few basic libraries automatically generated. You can


Add the required framework

Products seems to be used to publish an application. I haven't tested it yet.


The above shows how to create an iOS app in xcode and run it in the simulator.


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.