Joke Collection Website - Public benefit messages - How to make Apple mobile phone software by yourself?

How to make Apple mobile phone software by yourself?

Excerpted from Baidu experience/article/f2546a1ee8482c1b 8217.html.

I won't introduce how to use the Apple system here. Apple development needs a certain foundation of C language and OC language. I will write some experiences about C language and OC language when I have time. I will begin to introduce the software we need to develop: 1. Xcode (software download address:/xcode/); Second, the IOS emulator.

Xcode 5.0 installation

The downloaded installation package is a DMG file. After opening the DMG file, you will find the Xcode installation package and keep clicking NEXT.

Let's start making our first program. First, we open Xcode, create a new project and name it (I use MRC for manual memory management, and you can also use automatic memory management).

Do a small project for male compatriots who want to do it, a small program to make their girlfriends happy, and briefly introduce the simple usage of several controls.

The general content of the software is: there is an input box, enter a person's name in the input box, click the button to open the gift, and after the gift box is opened, a line of words: "XXX I love you" will be displayed in the box.

Just enter the name, and there is a button that says "open the gift". Click it a few times and the gift will open like a rose. . .

Let's get to know the size of the equipment first. Apple's devices have three resolutions, namely 320*480 and 320*568. Apple's device (0,0) is in the upper left corner. Here we use 320*480. The setting method is as follows.

We will add the pictures needed by this small program to our project first, so we must pay attention to the places we choose.

The project has been created, and we must first understand several controls that need to be used.

Text input box (UITextField)

Text display box (UILabel)

Button (ui button)

A control that displays a picture (UIImageView)

Text input box, as the name implies, is the box where you can input the required content, just like the input box where we send short messages; Text display box, that is, display the text we need; A button is the kind of button that can be clicked, such as the OK button. Controls that display pictures are controls that can put pictures, such as backgrounds. . .

This small program involves the creation of controls, some uses and functions of controls, and the declaration of methods.

Explain it with pictures.

First, declare several properties in "ViewController.h"

Then add some of our controls in "ViewController.m". Friends who use MRC for manual memory management should pay attention to calling dealloc method here to balance memory.

I have marked all the precautions in the code with comments.

"//"and "/* ... */"mean comments, that is, all light green words are comments, and the code of comments is not executed when the program runs.

Code will not be copied and pasted. Do you want to learn? Then learn to play by yourself! ! !

The following is the renderings. would you like to have a try?

You're finished. Go and entertain your friends! ! !