下面的代碼工作正常,直到我將SDWebImage
升級到V.3.7.3
,現在,它給了我一個錯誤。我把($$
)在開始和這標誌着我的錯誤代碼的結束,這是該行_HUD2 = [General showHUDInView:self.productImageView_
下,而實際上從這裏開始:completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType)...
不兼容的塊指針類型| Xcode 6.4 | iOS 8.4
- (void)parseResponse:(NSString *)xml{
NSData *data = [xml dataUsingEncoding: NSUTF8StringEncoding];
_parserDetails3 = [[NSXMLParser alloc] initWithData:data];
[_parserDetails3 setDelegate:self];
[_parserDetails3 setShouldProcessNamespaces:YES];
[_parserDetails3 setShouldReportNamespacePrefixes:NO];
[_parserDetails3 setShouldResolveExternalEntities:NO];
if (![_parserDetails3 parse]) {
NSLog(@"Error de parseo");
}
else if ([_details3 count] <= 0) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"INFORMATION", nil) message:NSLocalizedString(@"NO_DETAIL_MODAL", nil) delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
}
else {
NSLog(@"%d", [_details3 count]);
// Logic to fill general labels
_estiloLabel.text = [NSString stringWithFormat:@"%@ [%@]", [[_details3 objectAtIndex:0] estilo], [[_details3 objectAtIndex:0] nombreEst]];
_lineaLabel.text = [[_details3 objectAtIndex:0] linea];
_fechaSolLabel.text = [[_details3 objectAtIndex:0] fechaSol];
_chinelaLabel.text = [[_details3 objectAtIndex:0] pielChinela];
_tuboLabel.text = [[_details3 objectAtIndex:0] pielTubo];
_specIDLabel.text = [[_details3 objectAtIndex:0] specID];
NSLog(@"%@", [NSString stringWithFormat: IMAGES_PATH , [[_details3 objectAtIndex:0] imagenMuestra]]);
/*[self.productImageView setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat: IMAGES_PATH , [[_details3 objectAtIndex:0] imagenMuestra]]] placeholderImage:[UIImage imageNamed:@"cargando.gif"]];*/
HUD2 = [General showHUDInView:self.productImageView withTitle:NSLocalizedString(@"LOADING", nil) withDetail:NSLocalizedString(@"IMAGE", nil)];
//La solución de este método obsoleto es agregar 'sd_' a setImage (sd_setImageWithURL)
$$[self.productImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat: IMAGES_PATH , [[_details3 objectAtIndex:0] imagenMuestra]]] placeholderImage:[UIImage imageNamed:nil] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType)$$ {
[General hideHUD:HUD2];
}];
}
[_detail3TableView reloadData];
[_detail3TableView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
[General hideHUD:HUD];
}
Error:Incompatible block pointer types sending 'void (^)(UIImage *__strong, NSError *__strong, SDImageCacheType)' to parameter of type 'SDWebImageCompletionBlock' (aka 'void (^)(UIImage *__strong, NSError *__strong, SDImageCacheType, NSURL *__strong)')