Braintree iOS SDK 表示没有已知的 class 方法
Braintree iOS SDK saying no known class method
我遇到了这个错误。有人吗?
-(void)clientToken{
NSURL *clientTokenURL = [NSURL URLWithString:@"http://tectutiveclients.com/projects/carboss/api/getToken"];
NSMutableURLRequest *clientTokenRequest = [NSMutableURLRequest requestWithURL:clientTokenURL];
[clientTokenRequest setValue:@"text/plain" forHTTPHeaderField:@"Accept"];
[NSURLConnection
sendAsynchronousRequest:clientTokenRequest
queue:[NSOperationQueue mainQueue]
completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
// TODO: Handle errors in [(NSHTTPURLResponse *)response statusCode] and connectionError
clientToken = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
// Initialize `Braintree` once per checkout session
[Braintree setupWithClientToken:clientToken
completion:^(Braintree *braintree, NSError *error) {
UIViewController *dropin = [braintree dropInViewControllerWithDelegate:self];
[self presentViewController:[[UINavigationController alloc] initWithRootViewController:dropin]
animated:YES
completion:nil];
// No known class method for selector setupwithClientToken Error
}];
UIViewController *dropin = [self.braintree dropInViewControllerWithDelegate:self];
[self presentViewController:[[UINavigationController alloc] initWithRootViewController:dropin]
animated:YES
completion:nil];
}];
}
我在布伦特里工作。如果还有问题,请get in touch with our support team.
这是文档中的错误。相反,请使用 braintreeWithClientToken:
示例:
NSString *clientToken = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];
// Initialize `Braintree` once per checkout session
self.braintree = [Braintree braintreeWithClientToken:clientToken];
感谢您指出这一点!文档将很快更新。
我遇到了这个错误。有人吗?
-(void)clientToken{
NSURL *clientTokenURL = [NSURL URLWithString:@"http://tectutiveclients.com/projects/carboss/api/getToken"];
NSMutableURLRequest *clientTokenRequest = [NSMutableURLRequest requestWithURL:clientTokenURL];
[clientTokenRequest setValue:@"text/plain" forHTTPHeaderField:@"Accept"];
[NSURLConnection
sendAsynchronousRequest:clientTokenRequest
queue:[NSOperationQueue mainQueue]
completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
// TODO: Handle errors in [(NSHTTPURLResponse *)response statusCode] and connectionError
clientToken = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
// Initialize `Braintree` once per checkout session
[Braintree setupWithClientToken:clientToken
completion:^(Braintree *braintree, NSError *error) {
UIViewController *dropin = [braintree dropInViewControllerWithDelegate:self];
[self presentViewController:[[UINavigationController alloc] initWithRootViewController:dropin]
animated:YES
completion:nil];
// No known class method for selector setupwithClientToken Error
}];
UIViewController *dropin = [self.braintree dropInViewControllerWithDelegate:self];
[self presentViewController:[[UINavigationController alloc] initWithRootViewController:dropin]
animated:YES
completion:nil];
}];
}
我在布伦特里工作。如果还有问题,请get in touch with our support team.
这是文档中的错误。相反,请使用 braintreeWithClientToken:
示例:
NSString *clientToken = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];
// Initialize `Braintree` once per checkout session
self.braintree = [Braintree braintreeWithClientToken:clientToken];
感谢您指出这一点!文档将很快更新。