dispatch_semaphore_t signal = dispatch_semaphore_create(0);
dask = [NetWorkManager PostWithUrl:KAPI_RCIM_ConversationRelation Params:@{@"token":[UserManager share].userModel.token, @"to_user_id": modelIDString} successHander:^(id reponse) {
if ([reponse[@"code"] integerValue] == 0) {
dispatch_semaphore_signal(signal);
}else {
dispatch_semaphore_signal(signal);
}
} returnFailHander:^(id returnFail) {
dispatch_semaphore_signal(signal);
} failHander:^(NSError *error) {
dispatch_semaphore_signal(signal);
}];
dispatch_semaphore_wait(signal, DISPATCH_TIME_FOREVER);
return someThing;
网友评论