首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >PayPal集成iOS 8应用程序

PayPal集成iOS 8应用程序
EN

Stack Overflow用户
提问于 2014-10-12 23:26:16
回答 1查看 849关注 0票数 1

我已经下载并播放了贝宝ios应用的github项目。https://github.com/paypal/PayPal-iOS-SDK,我运行得很好,没有任何错误。当我试图将它链接到我的iOS 8快速项目时,我可以加载所有文件并连接视图控制器,我相信我的桥头文件工作得很好。基本上,我将示例应用程序中的所有视图控制器文件移到我的项目中,并将所需的内容连接起来。我相信我有客户身份和秘密身份。当我尝试创建一个FuturePaymentViewController时:

代码语言:javascript
运行
复制
 - (IBAction)getUserAuthorizationForFuturePayments:(id)sender {

       NSLog(@"\n\n\nbegin getting user authorization\n\n\nPAYPAL CONFIG::::   %@", self.payPalConfig);
       PayPalFuturePaymentViewController *futurePaymentViewController = [[PayPalFuturePaymentViewController alloc] initWithConfiguration:self.payPalConfig delegate:self];

       //breaks here when trying to send the config init.


        NSLog(@"\n\n\nafter initializtion of paypal future payment view controller\n\n\n");

        [self presentViewController:futurePaymentViewController animated:YES completion:nil];
        NSLog(@"after present");
 }

我得到的错误是:

代码语言:javascript
运行
复制
 PAYPAL CONFIG::::   <PayPalConfiguration: 0x7fb23e212af0>


 2014-10-12 16:31:38.979 Project[2161:69146] -[PayPalFuturePaymentViewController       payPalServiceManager]: unrecognized selector sent to instance 0x7fb23e2207d0
 2014-10-12 16:31:38.981 Project[2161:69146] *** Terminating app due to uncaught exception     'NSInvalidArgumentException', reason: '-[PayPalFuturePaymentViewController payPalServiceManager]:      unrecognized selector sent to instance 0x7fb23e2207d0'
 *** First throw call stack:
(
0   CoreFoundation                      0x00000001055bf3f5 __exceptionPreprocess + 165
1   libobjc.A.dylib                     0x0000000105258bb7 objc_exception_throw + 45
2   CoreFoundation                      0x00000001055c650d -[NSObject(NSObject)     doesNotRecognizeSelector:] + 205
3   CoreFoundation                      0x000000010551e7fc ___forwarding___ + 988
4   CoreFoundation                      0x000000010551e398 _CF_forwarding_prep_0 + 120
5   CutInLineSwift                      0x000000010262c0b1 -[PayPalFuturePaymentViewController initWithConfiguration:delegate:] + 361
6   CutInLineSwift                      0x00000001025d28de -[ZZMainViewController getUserAuthorizationForFuturePayments:] + 190
7   UIKit                               0x00000001029639ee -[UIApplication sendAction:to:from:forEvent:] + 75
8   UIKit                               0x0000000102a69bd0 -[UIControl _sendActionsForEvents:withEvent:] + 467
9   UIKit                               0x0000000102a68f9f -[UIControl touchesEnded:withEvent:] + 522
10  UIKit                               0x00000001029a93b8 -[UIWindow _sendTouchesForEvent:] + 735
11  UIKit                               0x00000001029a9ce3 -[UIWindow sendEvent:] + 683
12  UIKit                               0x0000000102976ae1 -[UIApplication sendEvent:] + 246
13  UIKit                               0x0000000102983bad _UIApplicationHandleEventFromQueueEvent + 17370
14  UIKit                               0x000000010295f233 _UIApplicationHandleEventQueue + 1961
15  CoreFoundation                      0x00000001054f4ad1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
16  CoreFoundation                      0x00000001054ea99d __CFRunLoopDoSources0 + 269
17  CoreFoundation                      0x00000001054e9fd4 __CFRunLoopRun + 868
18  CoreFoundation                      0x00000001054e9a06 CFRunLoopRunSpecific + 470
19  GraphicsServices                    0x00000001071eb9f0 GSEventRunModal + 161
20  UIKit                               0x0000000102962550 UIApplicationMain + 1282
21  CutInLineSwift                      0x00000001025d093e top_level_code + 78
22  CutInLineSwift                      0x00000001025d097a main + 42
23  libdyld.dylib                       0x0000000105f93145 start + 1
 )
  libc++abi.dylib: terminating with uncaught exception of type NSException

这不应该打破,因为没有什么不同的样本项目,但我不知道它是为什么。请帮帮我,谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-10-13 06:04:41

这里是PayPal的戴夫。

我相信你的问题会通过我们集成指令的第三步解决

在项目的Build Settings中(在TARGETS部分,而不是PROJECTS部分):

  • -lc++ -ObjC添加到Other Linker Flags

另外,请注意我们的示例代码的第一步,这表明在调用其他方法之前,必须调用[PayPalMobile initializeWithClientIdsForEnvironments:]来初始化SDK。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26331047

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档