📈
objective-c
  • 前言
  • 编译原理
    • 编译LLVM
    • 我的第一个Clang插件
    • 自定义LibTooling
    • 自定义属性
    • AST
    • Swift
  • Foundation
    • Number
    • NSString
    • Class
    • Category
    • 琐事
    • 多线程
    • ARC
    • RunLoop
    • 算法
  • Network
  • Animation
  • JavaScriptCore
  • 架构设计
  • 跨平台
    • Flutter
  • UIKit
    • UIView
    • AutoLayout
    • WebView
  • ApplePay
  • In-App Purchase
  • Reveal
  • Xcode
Powered by GitBook
On this page
  • NSURLConnection
  • NSURLSession
  • AFNetworking
  • CFNetworking

Was this helpful?

Network

NSURLConnection

已过时,苹果建议使用NSURLSession

//立即请求
- (instancetype)initWithRequest:(NSURLRequest *)request delegate:(nullable id)delegate;

//同步请求
+ (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NSURLResponse *)response error:(NSError **)error;

//同步请求,block回调
+ (void)sendAsynchronousRequest:(NSURLRequest*)request
                          queue:(NSOperationQueue*)queue
              completionHandler:(void (^)(NSURLResponse * response, NSData * data, NSError * connectionError)) handler;

NSURLSession

详见Demo

AFNetworking

详见Demo

CFNetworking

C语言编写的底层网络框架,详见Demo

Previous算法NextAnimation

Last updated 5 years ago

Was this helpful?