IOS development and learning process

Source: Internet
Author: User

IOS development and learning process
The following is a brief introduction of how I feel about iOS development. It is also an architecture for learning iOS development. 1 iOS development environment 1.1 The standard configuration of the development environment is Mac OS X + Xcode. Macbookpro is the preferred choice for maccosx. macmini is the cheapest as long as it is more than 4000 yuan, and then it should be equipped with a display. macbookpro is also acceptable. macbookair is not recommended. There are also many users who use black apple or virtual machines and even install some tools on windows. In addition, the official version can also be bought, It is very cheap to buy a good host, the official version. The Xcode development tool inherits the iPhoneSDK, so you do not need to download the SDK separately. You can download Simulators of different versions from Xcode. For iOS debugging machines such as 1.2 account certificates, you need to apply for an iDP account, there are a lot of certificates sold on a certain treasure. There are many ways for an app to upload an appstore. certificates can be classified into enterprises and individuals. Individuals can access the appstore, but enterprises cannot. 2 Obejct-c language Object-c language usually writes objective-c or obj-c. It is derived from the c language and inherits the features of c language, it is an object-oriented programming language that expands C and can be mixed with C and C ++. OC is a compilation language that uses the gcc compiler to compile object-c code into machine commands. For more information about the basic concepts, see Objective-C syntax (comparison with Java and C ++ ). 2.1 Dynamic Features Object-C has some dynamic features, including dynamic types, dynamic binding, and dynamic loading, that is, Object-C can know some Object types and called methods at runtime. 2.2 The Memory Management OC uses the reference counting principle. Now the OC introduces the ARC (automatic reference counting principle ). There are several rules for reference counting. First, who creates and releases the object, creates the object through alloc, new, and copy, and then calls release or autorelease to release the object. Second, except alloc, new, and copy, the created objects are autorelisted. The third object is retain and the object is released. 2.3 For some language features, OC has only one inheritance, but not multiple inheritance. Attribute access. After @ property is added with @ synthesize, the setter and getter methods can be automatically generated. Category, which is generally called a category. It can provide new methods for existing classes. It disperses the implementation of classes into multiple different files or frameworks, creates a forward reference to a private method and adds informal protocols to the object. Block syntax and block, which usually represent the self-contained code segments of small segments. Therefore, they are encapsulated as additional useful work units that can be executed in parallel and used for traversing in the set, you can also use this callback when other operations are completed. Blocks replace traditional callback functions with two meanings: one is that they allow nearby code writing in method implementation calls, and blocks are often used as parameters of some methods in the framework; second, they can access local variables. Many classes in OC start with NS, which is the class library of the Foundation framework in the cocoa layer. 3 iOS development 3.1 Introduction to iOS OS the architecture of iOS is divided into four layers: Core OS layer and Core Services layer) media layer and Cocoa Touch layer ). Each layer contains many system frameworks. For example, the famous UIKit framework is in cocoa touch. 3.2 The most common design pattern is the MVC pattern, which is to divide the project into Model, View and Controller layers for management. Common proxy modes are implemented through protocols and blocks. The observer mode is embodied in KVO and notification. The target-action mode is a very common method for calling methods between objects in OC. This mode is usually used to process various GUI events when dealing with the UI, it usually has a target as the receiver of the message. The Singleton mode allows the singleton object to be created only once in the project. The factory model is a kind of family concept and conforms to the open and closed principle of agile software development. For a variety of design patterns, you can refer to the columns of kundamo. 3.3 Interface Builder and Storyboard generally write iOS UI in three ways. Xib, Storyboard, and code creation. I have used xib for a while before, and I have been using code to create it. The code is easier to use multi-language versions, and xib startup requires slow event writing than code writing, the xib file is larger than the UI File Created by the Code. For detailed comparison, we can see that the ghost's Blog Code is hand-written. The game between xib and StoryBoard 3.4 is the most common system framework and the third-party library UIKit, which is mainly used for UI. Including view UIButton, UILabel, controller UIViewController, and some touch events and gestures. QuartzCore and CoreAnimation frameworks are some class libraries for drawing and animation. For third-party libraries, you can view the repository ranking of object-c on github, Search · GitHub. 3.5 there are four main data storage methods for iOS data storage. NSKeyedArchiver stores data in an archive format. The data object must comply with the NSCoding protocol. Archive data storage can only be archived, archived, and decompressed at a time. It can only be used for a small amount of data, and the data operation is clumsy. That is, if you want to change a small part of the data, decompress the entire data or archive the entire data. NSUserDefaults, used to save application settings and properties. Third, Write data into the file. Fourth, it is more complex than the first two, but it is also best to use. SQLite, which can be encapsulated by itself, FMDataBase and other third-party encapsulated libraries, and CoreData of the system. 3.6 There are several data communication methods for iOS communication: HTTP at the application layer, TCP or UDP socket interfaces encapsulated at the transmission layer, and Bluetooth communication. HTTP network services can generally request data through post, get, or soap. You can use the NSURL of the system or a third-party class library (MKNetWorkKit, AFNetWorking ), both types of databases can be cached. The data exchange formats are JSon and xml. The socket can be implemented through the socket of C language and CFNetwork of CoreFoundation framework, or the asyncsocket of a third-party class library. If Bluetooth 4.0 is used, the CoreBluetooth framework is used. 3.7 multithreading programming iOS supports NSThread, NSOperation, and GCD. NSThread is lighter than the other two, but you need to manage the thread lifecycle and synchronize the thread. Thread Synchronization locks data with a certain amount of system overhead. Operation does not need to care about thread management. GCD is a technology that replaces NSThread and operation. 3.8iPad development iPad and iPhone development are similar, but do not try to adapt to iPad and iPhone, because their UI is too different. 3.9 other iOS maps use the MapKit framework and CoreLocation for positioning. IOS has a cloud-based mechanism, while iOS also has a push mechanism, which can push messages from servers to mobile apps, and iOS can also be localized. IOS has some built-in sensors that can be used for programming, such as three-axis acceleration sensors for measuring acceleration, as well as gyroscope sensors, angle measuring speed, and sensing movement. There are corresponding class libraries for iOS cameras, photo albums, and audio and video. 4. The first is the issue of multi-person collaboration. You can use svn or git. git is popular, but most companies are still using svn. Second, there are many data persistence solutions for iOS, the most efficient of which is sqlite. There are many sqlite visual management tools on mac, and I use sqlitemanager. Third, the simulator can use SimPholders to view the content of the sandbox of the simulator or the real machine, and the real machine can use ifunbox. Fourth, the screen color Acquisition Tool, sip. Fifth, xcode can also install many auxiliary tools, such as formatting xcode code ClangFormat, third-party library management tool CocoaPods, and stress testing tool uiautomonkey. Sixth, mobile development has some common platforms, such as umeng, sharesdk, and internal testing platform fir, which provides social sharing and statistical analysis. im, dandelion; cloud testing platform testin; advertisement platform google admob 5 book website recommends reading books. It is not suitable for reading books for getting started with something, or you just want to pick a book to get started. Code4app, iOS development community-Open Source Chinese community, cocoachina is one of the three common Chinese code libraries. I will go to github, a version-controlled website, and welcome to my github, coderyi has a piece of iOS learning materials compiled by someone else. I am about to develop the iOS app (officially developed by apple), Aufree/trip-to-iOS · GitHub (the most comprehensive information ), iOS resource-Code4App.com: a 60-minute entry for iOS development. iOS development starts from new users to the shelves,

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.