【发布时间】:2020-07-09 11:19:03
【问题描述】:
由于不兼容的块指针类型在 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];
}
【问题讨论】:
-
不是最新的 objc 但似乎您尝试将
STPAPIResponseBlock传递给不匹配的函数参数。STAPIResponseBlock可能是专用块的类型别名,getWithApiClient方法需要completion参数的另一种块
标签: ios objective-c swift xcode11