我在我的应用中使用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];
答案 0 :(得分:1)
最后错误已经解决,需要检查pods和项目的编译器标志
答案 1 :(得分:1)
将两个项目的OTHER_LDFLAGS标志更改为$(继承)
将Pod项目和您自己的项目更改为