#import "ViewController.h"
#import "URLService.h"
#import "HttpRequest.h"
#import "Weather.h"
@interface ViewController ()
{
NSMutableDictionary *dic;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self getURLDatasWithCity:@"北京"];
}
#pragma mark ------请求天气
- (void)getURLDatasWithCity:(NSString *)MyCity {
URLService *urlSer = [[URLService alloc] initWithCompletion:^(id passData, BOOL success) {
dic = [[NSMutableDictionary alloc] init];
dispatch_async(dispatch_get_main_queue(), ^{
dic = [passData mutableCopy];
});
}];
[urlSer getWeatherByCity:MyCity];
}
网友评论