Reshad Zazai
Reshad Zazai

Reputation: 95

How to fix the incompatible block pointer types sending error?

The Build fails because of the incompatible block pointer types sending error in xcode 11.5.

- (NSURLSessionDataTask *)retrieveSourceWithId:(NSString *)identifier 
    clientSecret:(NSString *)secret 
    responseCompletion:(STPAPIResponseBlock)completion {
    NSString *endpoint = [NSString stringWithFormat:@"%@/%@", 
        APIEndpointSources, identifier];
    NSDictionary *parameters = @{@"client_secret": secret};
    return [STPAPIRequest<STPSource *> getWithAPIClient:self

                                           endpoint:endpoint

                                         parameters:parameters

                                       deserializer:[STPSource new]

                                         completion:completion];

}

enter image description here

Upvotes: 0

Views: 371

Answers (1)

Warren Burton
Warren Burton

Reputation: 17382

Observe the difference between two types of the block as described in the error.

You are sending

STPAPIResponseBlock aka ^(ResponseType, NSHTTPURLResponse, NSError)

Expected type is:

^(STPSource, NSHTTPURLResponse, NSError)

The first parameter of STPAPIResponseBlock isn't compatible.

However it appears that this might be a bug in the Stripe API

Confirm you have 14.0.1 or higher of the library. That might fix the issue.

Upvotes: 1

Related Questions