Overview of the iOS Development learning phase process

Source: Internet
Author: User
Tags gcd

Here's a quick introduction to my iOS development experience and an architecture for learning iOS development.

1 iOS development environment

1.1 Development environment

The standard configuration is Mac OS X + Xcode.

MacOSX words of choice with the Apple Computer, Macmini the cheapest as long as more than 4,000 good and then own a monitor, Macbookpro can also, not recommended to use Macbookair. There are also a lot of people who use black apples or virtual machines and even install some tools on windows that are undesirable.

Another official replica can also go to buy, very cheap can buy good machine, official replica.

Xcode itself inherits the IPHONESDK, so it's not necessary to download the SDK separately. The Debug emulator can download different versions of the emulator from Xcode.

1.2 Account certificate Shelves, etc.

iOS debugging Real machine is required certificate, so this time need to apply for an IDP account, but only need to debug, some treasure on a lot of sell 20 a few pieces of certificate. Application upload AppStore Words There are many ways, the certificate is divided into enterprises and individuals, individuals can go to AppStore, the enterprise is not possible.

2 Obejct-c languages

Object-c language is usually written objective-c or obj-c, according to C language derived from the language, inherited the C language characteristics, is the expansion of C-oriented programming language, it can be mixed with C, C + + programming. OC is a compiled language that compiles object-c code into machine instructions through the GCC compiler. The basic concept can be consulted, 10 minutes to let you understand the syntax of Objective-c (and Java, C + + comparison).

2.1 Dynamic characteristics

OBJECT-C has some dynamic characteristics, including dynamic type, dynamic binding, dynamic loading, which means that object-c can know the type of some objects and the method being called at runtime.

2.2 Memory Management

OC is using the reference counting principle, now OC introduces arc (automatic reference counting principle). There are several rules for reference counting, one is who creates who releases, creates objects through Alloc, new, and copy, and then calls release or Autorelease to release objects, and the second is, in addition to Alloc, Objects created outside new and copy are Autorelease, and the third who retain, and who releases them.

2.3 Some language features

OC First is only a single inheritance, no multiple inheritance.

Property access, @property plus @synthesize can automatically generate setter and getter methods after use.

Category, Chinese is generally called a class, he is able to provide new methods for existing classes, he scattered the implementation of the class into several different files or frameworks, create a forward reference to the private method, add an informal protocol to the object.

Block syntax, blocks, which typically represent small pieces of self-contained code snippets, so they are encapsulated as extra useful for working units that can be executed in parallel, can also be used to traverse in collections, or as callbacks when other operations are complete. The block replaces the traditional callback function with two meanings: one is that they allow the code to be written to the nearest part of the method's implementation, and that the block is often used as a parameter to some of the methods in the framework, and that they can access local variables.

There are many classes in OC that begin with NS, which is the class library of the foundation framework inside the cocoa layer.

3 iOS Development

3.1 iOS Operating system introduction

The system architecture of iOS is divided into four tiers: the core OS layer, the core service layer, the media layer, and the Cocoa touch layer. Each layer contains many system frameworks, such as the well-known Uikit framework that is in cocoa touch.

3.2 Common Design Patterns

The most basic is the MVC pattern, that is, the project is divided into model, view and controller layer three to manage.

There are also proxy modes, which are implemented by protocol and block. The observer pattern is reflected in the KVO and notification. The target-action pattern is a way of making method calls between objects that are very common in OC, and typically handles various GUI events when dealing with the UI, and he usually has a target as the recipient of the message. Singleton mode, which causes the singleton object to be created only once in the project. The factory model is a class family concept, which conforms to the open and closed principle of agile software development. For a variety of design patterns, you can see the column of the Dharma Initiative.

3.3 Interface Builder and storyboard

There are three ways to write iOS UI in general. Xib,storyboard and code creation.

I used to teach myself a xib, and then I used code to create it, and the code was easier to do in a multi-language version, and

Xib boot requires an event that is slower than writing directly with the code, and the Xib file is larger than the code-building UI file.

Specific comparison can see the meow of the blog code handwriting, xib and storyboard between the game

3.4 Common system frameworks and third-party libraries

Uikit is the most commonly used framework, mainly used to make the UI. Including views UIButton, UILabel, controller uiviewcontroller, etc., there are some touch events, gestures and so on.

Quartzcore, Coreanimation frame is a class library of some drawings and animations.

Third party libraries, you can view Object-c's warehouse rankings on GitHub, search GitHub.

3.5 Data storage

There are four main ways in which iOS data is stored.

Nskeyedarchiver, the data object is stored in an archive format, which is subject to the Nscoding protocol. Archive form save data only one-time archive save and one-time decompression, only for a small number of who, and data manipulation is clumsy, that is, if you want to change a small part of the data, you need to extract the entire data or archive the entire data.

Nsuserdefaults, which is used to save application settings and properties.

The third type, write writes to the file.

The fourth, more complex than the first two, but also best used. SQLite can be packaged in its own, can also use third-party packaging libraries such as fmdatabase, and can also use the coredata of the system.

3.6 Data Communication

There are several ways of data communication in iOS, the application layer of HTTP, and the encapsulation of the Transport layer TCP or UDP socket interface, there is Bluetooth communication.

HTTP network services can generally be used in post, get or SOAP request data, can use the system Nsurl can also use the third-party class library (Mknetworkkit, afnetworking), these two kinds of libraries can do cache, The format of data interchange generally has JSON and XML.

Sockets can be implemented through the cfnetwork of the socket and corefoundation framework of the C language, or they can be asyncsocket with a third-party class library.

Bluetooth 4.0 uses the Corebluetooth framework.

3.7 Multi-threaded programming

iOS has Nsthread, nsoperation, and gcd for multithreading. Nsthread is lighter than the other two, but requires itself to manage thread lifecycles and thread synchronization. Thread synchronization can have a certain overhead in locking data. Operation does not need to care about thread management, GCD is an alternative to nsthread and operation technology.

3.8iPad Development

ipad and iphone development are similar, but don't try to fit the ipad and iphone because their UI is too different.

3.9 Other

The iOS map is using the Mapkit frame, positioned with corelocation.

iOS has a cloud mechanism Icloud,ios also has a push mechanism that can be pushed by the server to the mobile app and iOS can also be localized.

iOS has some built-in sensors that you can use to program, such as a three-axis acceleration sensor for measuring acceleration, a gyroscope sensor, a angular velocity, a sensing movement.

There are class libraries for iOS cameras, albums, and audio and video.

4 Tools

The first is the problem of multi-person collaboration, you can use SVN or git,git is more popular, but most of the company is still using SVN;

Second, iOS data persistence has many programs, the most efficient is SQLite, on the Mac has a lot of sqlite visual management tools, I use Sqlitemanager.

Third, on the view simulator or the real machine sandbox content, the simulator can use Simpholders, the real machine can use the Ifunbox.

Four, the screen Color tool, sip.

Third, Xcode can also install a lot of auxiliary tools, for example, the format of the Xcode code Clangformat, three-party library management tool Cocoapods, pressure test tool uiautomonkey.

VI, mobile development has some common platform, than to provide social sharing, statistical analysis, such as the Friends of the Alliance, SHARESDK; fir.im platform, Dandelion, cloud test platform testin; advertising platform Google's AdMob

5 Book site recommendations

About reading, for the introduction of a certain thing, in fact, is not suitable for reading, or you want to see casually pick an introductory book to follow the look.

Code4app,ios Development Community – Open source China community, Cocoachina is the most commonly used three code base site, foreign I will be on the version control of the site GitHub, and welcome to follow my github,coderyi

Here's an iOS learning material that someone else has organized,

Start developing IOS apps right away (Apple's official finishing),

Aufree/trip-to-ios GitHub (full data),

iOS resource –code4app.com,

60-minute introduction to iOS development,

iOS development from novice to shelves,

6 iOS Learning Roadmap

Finally attached to the iOS learning route map of a smart podcast, which is just the tip of the iceberg of iOS development, which things to do to learn a lot of things to learn the most important thing is your passion for him, the road long its repair, I will go up and down and quest.

Overview of the iOS Development learning phase process

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.