Brain Tree 未定义的体系结构符号 x86_64:“_OBJC_CLASS_$_Braintree”
Brain Tree Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_Braintree"
我正在我的应用程序中使用 Braintree。但是在从我的服务器获取令牌并尝试初始化 Braintree 对象之后,它显示了以下错误(我正在使用 xCode v.7 和基础 SDK iOS 9.0 以及 PODS),
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Braintree", referenced from:
objc-class-ref in WZBrainTreeDemoViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
当我删除这段代码时,它可以正常工作,但随后它将控制器显示为 nil,
这是我初始化和呈现控制器的代码,
strToken = dictResponse[@"braintree_client_token"];
// If you haven't already, create and retain a `Braintree` instance with the client token.
// Typically, you only need to do this once per session.
self.braintree = [Braintree braintreeWithClientToken:strToken];
// Create a BTDropInViewController
BTDropInViewController *dropInViewController = [self.braintree dropInViewControllerWithDelegate:self];
// This is where you might want to customize your Drop in. (See below.)
// The way you present your BTDropInViewController instance is up to you.
// In this example, we wrap it in a new, modally presented navigation controller:
dropInViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
target:self
action:@selector(userDidCancelPayment)];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:dropInViewController];
[self presentViewController:navigationController animated:YES completion:nil];
终于解决了错误,需要检查 pods 和项目
的编译器标志
将项目(即 Pod 项目)和您自己的项目的 OTHER_LDFLAGS 标志更改为 $(inherited)
我正在我的应用程序中使用 Braintree。但是在从我的服务器获取令牌并尝试初始化 Braintree 对象之后,它显示了以下错误(我正在使用 xCode v.7 和基础 SDK iOS 9.0 以及 PODS),
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Braintree", referenced from:
objc-class-ref in WZBrainTreeDemoViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
当我删除这段代码时,它可以正常工作,但随后它将控制器显示为 nil,
这是我初始化和呈现控制器的代码,
strToken = dictResponse[@"braintree_client_token"];
// If you haven't already, create and retain a `Braintree` instance with the client token.
// Typically, you only need to do this once per session.
self.braintree = [Braintree braintreeWithClientToken:strToken];
// Create a BTDropInViewController
BTDropInViewController *dropInViewController = [self.braintree dropInViewControllerWithDelegate:self];
// This is where you might want to customize your Drop in. (See below.)
// The way you present your BTDropInViewController instance is up to you.
// In this example, we wrap it in a new, modally presented navigation controller:
dropInViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
target:self
action:@selector(userDidCancelPayment)];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:dropInViewController];
[self presentViewController:navigationController animated:YES completion:nil];
终于解决了错误,需要检查 pods 和项目
的编译器标志将项目(即 Pod 项目)和您自己的项目的 OTHER_LDFLAGS 标志更改为 $(inherited)