[session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
if(data.length == 8)
{
w = ...
h = ...
return CGSizeMake(w, h);
}
return CGSizeZero;
}];
错误信息:Incompatible block pointer types sending 'CGSize (^)(NSData * _Nullable __strong, NSURLResponse * _Nullable __strong, NSError * _Nullable __strong)' to parameter of type 'void (^ _Nonnull)(NSData * _Nullable __strong, NSURLResponse * _Nullable __strong, NSError * _Nullable __strong)'
产生原因 :block 中调用return 导致 , 解决办法就是去掉返回改用其他方式回调数据
网友评论