我正在尝试按照 nativescript 插件种子(iOS 说明https://docs.connect.squareup.com/payments/readersdk/setup-ios)为 Square Reader 创建一个新插件。最后一步是传入一个UIViewController
对象,以便它可以在您的应用程序中显示结帐页面。尝试传入所需的参数时,我一直收到如下错误:
-[SquareReader checkoutController:didFailWithError:]:无法识别的选择器发送到实例 0x10aa5c960 * JavaScript 调用堆栈:( 0 UIApplicationMain@[native code] 1 start@file:///app/tns_modules/tns-core-modules/application/application. js:272:26 2 anonymous@file:///app/app.js:4:18 3 evaluate@[native code] 4 moduleEvaluation@:1:11 5 @:7:48 6 promiseReactionJob@:1:11) *Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SquareReader checkoutController:didFailWithError:]: unrecognized selector sent to instance 0x10aa5c960' *** First throw call stack: (0x185676d8c 0x1848305ec 0x185684098 0x18567c5c8 0x18556241c 0x1019b21f4 0x184f68aa0 0x184f68a60 0x184f7565c 0x18561f070 0x18561cbc8 0x18553cda8 0x187522020 0x18f55c758 0x101640044 0x10163e7a4 0x10163e26c 0x100cf5630 0x1012f0e14 0x1012f9a24 0x1012f9a34 0x1012f2ee0 0x10128c198 0x101261e94 0x1013f6b9c 0x100d0a354 0x101492964 0x1012fa494 0x1012f9a34 0x1012f9a34 0x1012f9a34 0x1012f2ee0 0x10128c198 0x101261e94 0x1013f6c80 0x10148e8e0 0x100d01898 0x100d47f50 0x10079629c 0x184fcdfc0)
我正在尝试UIViewController
在我的演示应用程序中实现:
导出类 HelloWorldModel 扩展 UIViewController { ... }
错误来自以下几行:
让 checkoutController = new SQRDCheckoutController( {parameters: params, delegate: this }); checkoutController.presentFromViewController(view);
我制作的具有功能 (我需要实现)并且是该类的实例化的this
类对象在哪里。SquareReader
checkoutControllerDidFailWithError
SQRDCheckoutControllerDelegate
view
HelloWorldModel
我没有看到将UIViewController
s 传递给 {N} 中的原生 iOS 方法的任何内容,但我发现https://discourse.nativescript.org/t/example-of-extending-uiviewcontroller-in-angular-2-and-nativescript/ 469
哪个可能是相似的?