[英](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.