iOS:如果应用未在后台运行,则调用openURL会使应用在启动时崩溃 [英] iOS : If app is not running in background,calling openURL crashes app on launch
问题描述
我正在尝试从外部URL(使用链接 myapp://sale/1234
从电子邮件/网页中)将应用启动到特定视图.
I am trying to launch my app to a specific view, from an external url (from email/webpage using link myapp://sale/1234
).
如果该应用尚未在后台运行,则该应用在启动时崩溃.
If the app is not already running in background,app is crashing on launch.
如果应用程序在后台运行,则完美调用 application:openURL:sourceApplication:annotation:
.
If the app is running in the background, application:openURL:sourceApplication:annotation:
is called perfectly.
请帮帮我.
推荐答案
我的错,是coredata manageObjectContext,在调用openUrl时未创建.如果未创建上下文,则保存URL,并在创建ManagedObjectContext之后调用openUrl.OpenUrls与我的崩溃无关.它总是可以正常工作...还是非常感谢.
My fault fellas, it was coredata manageObjectContext, which was not created when openUrl is called. I am saving the url if context is not created and calling the openUrl after managedObjectContext is created. OpenUrls has nothing to do with my crash. it always works as fine... Thanks a lot anyways.
这篇关于iOS:如果应用未在后台运行,则调用openURL会使应用在启动时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!