presentViewController 不存在
presentViewController does not exist
我正在用 NativeScript 构建一个插件。
当我尝试访问 rootViewController 上的 "presentViewController" 方法时,出现错误 "property presentViewContrller does not exist".
const rvc = UIApplication.sharedApplication.keyWindow.rootViewContrller;
rvc.presentViewContrller(myViewController, true, completion() {});
它建议使用不接受我的视图控制器的 presentViewContrllerAnimatedCompletion。
能否请您协助我的代码(或设置!)的哪一部分是错误的?
正确的方法名只有presentViewControllerAnimatedCompletion
。
在编组 Objective C 到 JS/TS 时,您应该将参数名称与方法名称结合起来。
presentViewController:animated:completion
我正在用 NativeScript 构建一个插件。 当我尝试访问 rootViewController 上的 "presentViewController" 方法时,出现错误 "property presentViewContrller does not exist".
const rvc = UIApplication.sharedApplication.keyWindow.rootViewContrller; rvc.presentViewContrller(myViewController, true, completion() {});
它建议使用不接受我的视图控制器的 presentViewContrllerAnimatedCompletion。
能否请您协助我的代码(或设置!)的哪一部分是错误的?
正确的方法名只有presentViewControllerAnimatedCompletion
。
在编组 Objective C 到 JS/TS 时,您应该将参数名称与方法名称结合起来。
presentViewController:animated:completion