OC and iOS Development

Source: Internet
Author: User
Tags gcd uikit

Obejctive-c language
2.1 Dynamic characteristics
OBEJCTIVE-C has some dynamic characteristics, including dynamic type, dynamic binding, dynamic loading, which means that obejctive-c can know the type of some objects and the method being called at runtime.
2.2 Memory Management
Obejctive-c is using the reference counting principle, and now Obejctive-c 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
Obejctive-c first, there is only a single inheritance, no multiple inheritance.
Property access, @property plus @synthesize can automatically generate setter and getter methods after use.
Category, which provides a new method for an existing class that disperses the implementation of the class into several different files or frameworks, creates a forward reference to the private method, and adds an informal protocol to the object.
Block syntax, blocks, which typically represent small pieces of self-contained snippets of code, so they are encapsulated as extra useful for working units that can be executed in parallel, and can be used to traverse through the collection 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.

 ios Development
3.1 iOS operating system Introduction
iOS system architecture is divided into four tiers: Core OS layer, Core services layer, media layer, and touch layers (Cocoa touch layer). Each layer contains many system frameworks, such as the well-known Uikit framework that is in cocoa Touch.
3.2 mvc and common design Patterns
MVC is not a design pattern, it is a software architecture model that divides the project into model, view, and controller three layers for management. The
commonly used design pattern has proxy mode, which is implemented by protocol and block. The observer pattern is reflected in the KVO and nsnotification. The target-action pattern is a way of method calls between objects that are very common in objective-c, 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.
3.3 Interface builder and storyboard
generally write iOS UI in three different ways. Xib,storyboard and code creation. The code is much easier to do in the language version, and the
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. The
3.4 common system Framework
Uikit is the most commonly used framework, primarily for UI. Including views UIButton, UILabel, controller uiviewcontroller, etc., there are some touch events, gestures and so on. The
Quartzcore, coreanimation Framework is a class library of drawings and animations.

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. Nsoperation does not need to care about thread management, GCD is an alternative to nsthread and nsoperation technology.

3.8 ipad 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 of the simulator or the real machine sandbox content, the simulator can use Simpholders, the real machine can be used ifunbox, screen Color tool, Sip.
IV, about the clutch tool Charles many people like to use
In addition, Xcode can also install a lot of auxiliary tools, such as third-party library management tool Cocoapods, stress test tool uiautomonkey.
Six, Xcode can also install a lot of plug-ins, first introduced a plug-in management plug-in Alcatraz, use it to download and manage all plug-ins, I commonly used plug-ins, formatted Xcode code clangformat, picture resource hints ksimagenamed, Color assist colorsense and so on.
Seven, mobile development has some common platform, than to provide social sharing, statistical analysis, such as friends, SHARESDK; fir.im platform, Dandelion, cloud test platform testin; advertising platform Google's AdMob

Source: http://www.coderyi.com/archives/397

OC and iOS Development

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.