美文网首页
ios--网络请求

ios--网络请求

作者: 井底蛙之呱呱 | 来源:发表于2017-11-21 15:47 被阅读25次
    #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];
    }
    

    相关文章

      网友评论

          本文标题:ios--网络请求

          本文链接:https://www.haomeiwen.com/subject/ymjwvxtx.html