简体   繁体   English

(Objective-C)打开视图控制器

[英](Objective-C) Open view controller

In my project, I have a Table View Controller with class NieuwsViewController . 在我的项目中,我有一个带有NieuwsViewController类的Table View Controller。 I want this VC to be opened when the app is opened through a push message. 我希望通过推送消息打开应用程序时打开此VC。

I assume this has to be done in AppDelegate.m in ' application didFinishLaunchingWithOptions ' or ' didReceiveRemoteNotification ', but then what? 我认为这必须在AppDelegate.m中的“ application didFinishLaunchingWithOptions ”或“ didReceiveRemoteNotification ”中完成,但是那又是什么呢?

You can take a look at this to handle URL scheme. 您可以看一下来处理URL方案。

You need to instantiate your UIViewController in handleOpenURL (with instantiateViewControllerWithIdentifier if you use storyboard for example) and then you will be able to present it (or to push it depending what you want). 您需要在handleOpenURL实例化UIViewController (例如,如果使用情节handleOpenURL话,请使用handleOpenURL instantiateViewControllerWithIdentifier ),然后就可以呈现它(或根据需要推送它)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Objective-C中的详细视图控制器 - Detailed view controller in Objective-C Objective-C以编程方式在另一个视图控制器上显示一个视图控制器 - Objective-C Showing a view controller on another view controller programmatically Objective-C当前视图控制器及其导航控制器 - Objective-C Present View Controller with its Navigation Controller 将变量传递给Objective-C中嵌入在导航控制器中的View Controller - Pass variable to View Controller Embedded in Navigation Controller in Objective-C 从模态(objective-c)引用视图控制器 - Reference presenting view controller from modal (objective-c) 如何在另一个视图控制器中控制对象? (Xcode:objective-c) - How to control objects in another view controller? (Xcode:objective-c) 如何从iOS Objective-C中的控制器重绘自定义视图 - how to redraw custom view from the controller in ios objective-c 使用Objective-C以编程方式设置子视图的视图控制器 - Setting a subview's view controller programatically with objective-c 在Objective-C中调用swift视图控制器文件的变量 - Calling to a variable of swift view controller file in Objective-C Objective-C-在视图控制器解雇UIAlertView中提示的位置 - Objective-C - Where to prompt in UIAlertView on view controller dismissal
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM