【问题标题】:ios - when opening a push notification while the app is active, it cases a crashios - 在应用程序处于活动状态时打开推送通知时,会导致崩溃
【发布时间】:2013-03-31 15:20:32
【问题描述】:

我正在测试推送通知。我有这种情况:

当我在随机屏幕上时,我收到推送通知并打开该通知,系统会尝试将我带到推送通知强制执行的屏幕。这会导致似乎是一个 segue 错误:

Mar 31 11:08:52 ancient-phone Marketing[14788] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[LoginController openBusinessTopic]: unrecognized selector sent to instance 0x1c5b3ae0'
    *** First throw call stack:
    (0x318412a3 0x394db97f 0x31844e07 0x31843531 0x3179af68 0x40ae3 0x337f290d 0x337f1f6b 0x33649d59 0x336496cd 0x3364911b 0x3534a5a3 0x3534a1d3 0x31816173 0x31816117 0x31814f99 0x31787ebd 0x31787d49 0x353492eb 0x3369d301 0x404ff 0x39912b20)

如何防止这种情况发生?发生这种情况的原因是什么?有没有办法解决这个问题?

谢谢!

【问题讨论】:

    标签: ios objective-c ios5 ios6 urbanairship.com


    【解决方案1】:

    您的错误表明正在向LoginController 发送openBusinessTopic 消息,并且此类未实现该方法。您可以在 LoginController 类中实现 openBusinessTopic,或者尝试确定是否有其他对象应该发送该消息。

    【讨论】:

    • 谢谢,发生的原因是因为我碰巧最后一次出现在 LoginController 屏幕上。因此,openBusinessTopic 不会自然而然地与之分离。
    • 我的代码试图做的是从 AppDelegate 开始,然后调用 ViewController 并且那个控制器有那个 segue
    • 查看执行此操作的代码会很有帮助。您可以将其添加到您的问题中吗?
    猜你喜欢
    • 1970-01-01
    • 2018-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多