Скажем, у меня есть этот метод, который с учетом URL-адреса возвращает UIImage:
- (void)getUIImageFromURL:(NSURL *)URL {
NSURLRequest *request = [NSURLRequest requestWithURL:URL];
AFHTTPRequestOperation *imageOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
imageOperation.responseSerializer = [AFImageResponseSerializer serializer];
[imageOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
return (UIImage *)responseObject;
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
}];
[imageOperation start];
}
Но он продолжает выдавать мне эту ошибку:
Несовместимые типы указателей блоков отправляют "UIImage *(^)(AFHTTPRequestOperation *__strong, _strong id)" в параметр типа "void (^)(AFHTTPRequestOperation *_strong, __strong id)"
Я немного новичок в блоках, поэтому, возможно, я подхожу к этому совершенно наоборот. Как лучше всего реализовать такой метод?