gpt4 book ai didi

ios - Paypal 集成 iOS 8 应用程序

转载 作者:行者123 更新时间:2023-11-29 12:35:53 26 4
gpt4 key购买 nike

我已经下载并使用了 paypal ios 应用程序的 github 项目。 https://github.com/paypal/PayPal-iOS-SDK我运行得很好,没有任何错误。当我尝试将它链接到我的 iOS 8 swift 项目时,我可以加载所有文件并很好地连接 View Controller ,我相信我的桥头文件工作得很好。我基本上将示例应用程序中的所有 viewcontroller 文件移到了我的项目中,并且只连接了我需要的内容。我相信我有客户端 ID 和 secret ID。当我尝试创建 FuturePaymentViewController 时:

 - (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");
}

我得到的错误是:

 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

这应该不会中断,因为与示例项目没有什么不同,但我不知道为什么会这样。请帮助我,谢谢!

最佳答案

来自 PayPal 的 Dave。

我相信您的问题将通过我们 integration instructions 的第 3 步得到解决:

In your project's Build Settings (in the TARGETS section, not the PROJECTS section):

  • add -lc++ -ObjC to Other Linker Flags

另外,请注意Step 1我们的示例代码,这表明您必须先调用 [PayPalMobile initializeWithClientIdsForEnvironments:] 来初始化 SDK,然后再调用其他方法。

关于ios - Paypal 集成 iOS 8 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26331047/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com