使用YKTNetwork做网络请求,连续发布任务网络POST请求,连续发布多条任务,出现延迟现象
Xb新博网址多少
Xb新博网址多少
当前位置 : Xb新博网址多少 > 新博nb88官网

使用YKTNetwork做网络请求,连续发布任务网络POST请求,连续发布多条任务,出现延迟现象

这是一个发布任务按钮点击事件,create继承YKTBaseNetwork,类似于模型 大神带我

- voidaddTaskClickAndFaBu
{
  

    //收回键盘
     [self.taskConTextView resignFirstResponder];
    
    [self getCurentNetwork];
    
    
    NSString *t_taskContent=[NSString stringWithFormat:@"%@",[resutlDict valueForKey:@"neirong"]];
    NSString *t_time_id=@"";//d1今天截止2明天截止3本周截止4持续推进
    NSString *timeID=[NSString stringWithFormat:@"%@",[resutlDict valueForKey:@"jiezhiriqi"]];
    if [timeID isEqualToString:@"今天截止"] {
        t_time_id=@"1";
    }
    else if [timeID isEqualToString:@"明天截止"] {
        t_time_id=@"2";
    }
    else if [timeID isEqualToString:@"本周截止"] {
        t_time_id=@"3";
    }
    else if [timeID isEqualToString:@"持续推进"] {
        t_time_id=@"4";
    }
    else{
        t_time_id = @"1";
    }
    
    NSString *remind_time=[NSString stringWithFormat:@"%@",[resutlDict valueForKey:@"tishishijian"]];
    
    
    NSString *projectid = [NSString stringWithFormat:@"%@",[resutlDict valueForKey:@"xiangmuID"]];
    
    if [projectid isEqualToString:@"null"] {
        
        t_projectId =@"";
    }else
    {
        t_projectId=[NSString stringWithFormat:@"%@",projectid];
    }
    
    NSString *xiangmuboardID = [NSString stringWithFormat:@"%@",[resutlDict valueForKey:@"xiangmuboardID"]];
    
    NSString *member=[NSString stringWithFormat:@"%@",[resutlDict valueForKey:@"tongshiID"]];
    
    CreateNewTaskAPI *create = [CreateNewTaskAPI new];
    create.t_taskContent = t_taskContent;
    create.t_time_id = t_time_id;
    
    if ![remind_time isEqualToString:@""] {
        //提醒时间
       create.remind_time = remind_time;
    }
    
    //项目小组id
    if ![t_projectId isEqualToString:@""] {
        
         create.t_projectId = t_projectId;
    }
    //敏捷流程面板id
    if ![xiangmuboardID isEqualToString:@""] {
         create.t_panel_id=xiangmuboardID;
    }
    
    // 任务相关成员id多个成员用逗号隔开
    if ![member isEqualToString:@""] {
        
        create.member=member;

    }
//    dispatch_queue_t aQueue = dispatch_get_global_queueDISPATCH_QUEUE_PRIORITY_DEFAULT, 0;
//
//    dispatch_asyncaQueue, ^{
//        
//        
//        
//    };
//    
//    
    [create startWithCompletionBlockWithSuccess:^YTKBaseRequest *request {
        
        NSLog@"++++++++++++++%@",request.responseJSONObject;
      
        ifrequest.responseJSONObject{
            
            TaskModel *model=[TaskModel mj_objectWithKeyValues:request.responseJSONObject];
            NSLog@"%@",model.status;
            if model.status {
                
//                [HUDView showWithOnlyText:@"发布失败"];
            }
            else{
                
                
                if self.taskcontent {
                    //返回聊天界面
                    [self.navigationController popViewControllerAnimated:YES];
                }
                else{
                
//                    跳转到详情界面
                    WTaskDetailViewController * taskDetailViewController = [[WTaskDetailViewController alloc] init];
                    
                    taskDetailViewController.hidesBottomBarWhenPushed = YES;
                    taskDetailViewController.task = model;
                    
                    taskDetailViewController.orderBy=self.orderBy;
                    taskDetailViewController.isFromListOrCreate = 2;
                    
                    [self.navigationController pushViewController:taskDetailViewController animated:YES];
                
                }

               }
            
        }
        else{
            
            
//            [HUDView showWithOnlyText:@"发布失败"];
            [HUDView hide];

        }

        
    } failure:^YTKBaseRequest *request {
        
//        [HUDView showWithOnlyText:@"发布失败"];
        [HUDView hide];
    }];
    

这个问题已经解决,不是第三方有问题,是我项目在返回按钮键下面添加了列表刷新界面,导致主线程堵塞

栏目列表

广告位

Xb新博网址多少