iOS Technology interview 07: third-party framework

Source: Internet
Author: User

The 1ios framework is divided into :cocoa touch:uikit,Foundation, subsidiary framework

Media:OpenGL ES,eagl,Quartz,core Animation,core Audio , Open Audio Library,Media Player

Core services:address Book,core Foundation

Core OS: threads , files,I/O, memory, and network

2iOS Network programming hierarchy four intentions :

Cocoa Layer (nsurl,Bonjour,game Kit, WebKit)

Core Foundation layer ( C - based cfnetwork,cfnetServices)

OS Layer ( BSD socketbased on C)

3 How do I correctly use the MRC third-party framework in the ARC project?

ASIHTTPRequest currently does not support ARC, the workaround is as follows:

"Select TARGETS, then select the Buildnphases tag

"Expand Compile Sources

"After all asihttprequest related files , add the Compile option to the Compiler Flags:-Fno-objc-arc

Use of the 4SDWebImage framework

Download Resource bundle in https://github.com/rs/SDWebImage ,down load ZIP

A uiimageview class that adds the ability to asynchronously download remote pictures and manage picture caches for the Cocoa Touch framework.

Use of the afnetworking framework : https://github.com/AFNetworking/AFNetworking/

Website address: http:afnetworking.com

Steps to use:

(1) Drag and drop the framework program into the project

(2) add IOS Frame Reference

-systemconfiguration.framework

-mobilecoreswevices.framework

(3) modify xxx-prefix.pch file

#import < mobilecoreswevices/mobilecoreswevices.h>

#import < systemconfiguration/systemconfiguration.h>

Use of the Mbprogresshud framework : Https://github.com/jdg/MBProgressHUD

FMDB Framework Download: Https://github.com/ccgus/fmdb

Use of the ASI framework :http://github.com/Pokeb/asi-http-request/tarball/master

5 How do I implement file uploads without using a third-party framework ?

Use Nsurlconnection to send HTTP requests

6 How do I implement a breakpoint continuation without using a third-party framework?

The range Property of the header that requires a custom urlrequest

7 Why choose a third-party framework? the third-party framework encapsulates complex network underlying operations into friendly classes and methods, and adds exception handling to enable efficient data exchange with server-side APIs , improving development efficiency and stability

8 principles for selecting a third-party framework:

"is widely used, there are enough technical Daniel to verify;"

"Try to make sure you can read all the code

"You can learn to write some of these methods, but don't modify them directly.

9 Common IOS Web Development Framework :AFN and ASI(non- ARC), subsidiary Framework Ssziparchiver (: https://github.com/samsoffes/ssziparchive

AFN VS ASI

AFN: Use the method to define a HTTPClient for a series of related requests , sharing a BaseURL.

Based on Nsurl, the performance and stability are slightly poor;

It only encapsulates some functions, satisfies the basic requirement, ignores the extended function;

Encapsulation of the respective processors for JSON,XML,Plist,Image four data structures

ASI: Using methods each request is initialized by a constructor method to an instance of the

Based on Cfnetwork, the performance stability is relatively high .

extensive function of expansion;

There is no special encapsulation for data types, just a few of the various interfaces and tools are reserved for developers to expand themselves.

selection of 10AFN and ASI

AFN is suitable for simple logic applications and is suitable for the development of resource-rich teams

ASI is suitable for applications that have been in development for some time, or to develop a team with relatively rich resources

iOS Technology interview 07: third-party framework

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.