使用BlackBerry Dynamics SDK时如何访问rootViewController
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用BlackBerry Dynamics SDK时如何访问rootViewController相关的知识,希望对你有一定的参考价值。
我正在部署具有多个视图控制器的ios 13应用程序(使用情节提要,没有导航控制器,没有启动屏幕)。为了关闭/显示视图控制器,我使用以下代码:
@objc func onMenuItemUploadsTap(_ sender: UIView) {
self.view.window!.rootViewController?.dismiss(animated: false, completion: {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let vc = appDelegate.getViewController(viewController: .Uploads)
vc.modalPresentationStyle = .fullScreen
UIApplication.shared.windows.first!.rootViewController!.present(vc, animated: true, completion: nil)
})
}
实例化viewController后,我将它们保留在AppDelegate中,因为用户可以从viewController跳转到viewController因此,viewController必须保持其状态/值,这就是为什么要使用:
let vc = appDelegate.getViewController(viewController: .Uploads)
好吧……当我在发布模式下运行该应用程序时,仅显示初始viewController(名为:HomeController),而不显示我想展示的'vc',调试控制台让我知道:]]
Attempt to present <XXX.UploadController: 0x7ffc71152400> on <UIViewController: 0x7ffc70714c40> whose view is not in the window hierarchy!
注意:UIViewController:0x7ffc70714c40不是HomeController!(“ HomeController”在情节提要中标记为:是初始视图控制器)
在调试模式下(没有BlackBerry SDK),该应用程序运行正常。
我的AppDelegate :: didFinishLaunchingWithOptions ...:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. #if !DEBUG XXXGDiOSDelegate.sharedInstance.appDelegate = self GDiOS.sharedInstance().authorize(XXXGDiOSDelegate.sharedInstance) #else let controller = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "HomeController") as? HomeController window = UIWindow() window?.makeKeyAndVisible() window?.rootViewController = controller #endif return true }
我的问题:使用BlackBerry SDK时如何访问rootViewController?
我正在使用:macOS Mojave 10.14.6,xCode 11.1(11A1027),BlackBerry_Dynamics_SDK_for_iOS_v6.1.0.170
提前感谢!
我尝试过:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. let controller = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "HomeController") as? HomeController window = UIWindow() window?.makeKeyAndVisible() window?.rootViewController = controller #if !DEBUG XXXGDiOSDelegate.sharedInstance.appDelegate = self GDiOS.sharedInstance().authorize(XXXGDiOSDelegate.sharedInstance) #endif return true }
和
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
#if !DEBUG
XXXGDiOSDelegate.sharedInstance.appDelegate = self
GDiOS.sharedInstance().authorize(XXXGDiOSDelegate.sharedInstance)
#endif
let controller = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "HomeController") as? HomeController
window = UIWindow()
window?.makeKeyAndVisible()
window?.rootViewController = controller
return true
}
我正在部署具有多个视图控制器的iOS 13应用程序(使用情节提要,没有导航控制器,没有启动屏幕)。对于关闭/显示视图控制器,我使用...
我的解决方案...我遵循了以下指示(目标-c:):
以上是关于使用BlackBerry Dynamics SDK时如何访问rootViewController的主要内容,如果未能解决你的问题,请参考以下文章
使用Blackberry SDK为Playbook编译的命令行
使用Blackberry JAVA SDK 6.0活动指示器UI元素加载屏幕轮
Dynamics CRM SDK - 带有 OrganizationServiceContext 的 linq 的 IN 运算符
是否可以在没有 SDK 的情况下调用 Dynamics CRM 2011 后期绑定 WCF 组织服务 - 直接自定义绑定?