- 简单的网络请求
-(void) loadListData{
NSString *urlString = @"https://wanandroid.com/wxarticle/list/408/1/json";
NSURL *url= [NSURL URLWithString:urlString];
// __unused NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSURLSession *session =[NSURLSession sharedSession];
NSURLSessionDataTask * dataTask = [session dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
}];
[dataTask resume];
NSLog(@"");
}
-
IOS 9 开始不支持 http, http请求需要改动 Info.lsit
image.png
网友评论