iOS:如果应用未在后台运行,则调用openURL会使应用在启动时崩溃 [英] iOS : If app is not running in background,calling openURL crashes app on launch

查看:82
本文介绍了iOS:如果应用未在后台运行,则调用openURL会使应用在启动时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从外部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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆