Json解析

AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];

    //设置解析器类型

    manager.responseSerializer = [[AFJSONResponseSerializer alloc]init];


    NSURL *url = [NSURL URLWithString:TEST_URL];


    NSURLRequest *request = [[NSURLRequest alloc]initWithURL:url];


    NSURLSessionDataTask *task = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {


        self->_dic = responseObject;

        [self->_tbv reloadData];

    }];


    [task resume];

}

你可能感兴趣的:(Json解析)