异步请求与异步刷新

异步请求

[NSURLConnection sendAsynchronousRequest:request queue:[[NSOperationQueue alloc]init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {

        

        //可以看data里的值

        NSLog(@"data = %@",[[NSString alloc] initWithData:data encoding:4]);


 }];


异步刷新

[self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:self waitUntilDone:YES];


你可能感兴趣的:(异步请求,异步刷新)