用GCD线程组与GCD信号量将异步线程转换为同步线程
有时候我们会碰到这样子的一种情形: 同时获取两个网络请求的数据,但是网络请求是异步的,我们需要获取到两个网络请求的数据之后才能够进行下一步的操作,这个时候,就是线程组与信号量的用武之地了. #import "ViewController.h" #import <AFNetworking.h> @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; [self getNetworkingData]; } - (void)getNetworkingData{ NSString *appIdKey = @"8781e4ef1c73ff20a180d3d7a42a8c04"; NSString* urlString_1 = @"http://api.openweathermap.org/data/2.5/weather"; NSString* urlString_2 = @"http://api.openweathermap...
