gpt4 book ai didi

ios - Today Extension 在 iOS 8.1.2 上启动前崩溃

转载 作者:IT王子 更新时间:2023-10-29 08:22:06 24 4
gpt4 key购买 nike

我一直在制作今天的扩展程序,它可以从提要下载文章并显示最新的文章。整个事情在 iOS 8 上运行良好,仍然在 iOS 8.1 上运行,然后是 iOS 8.1.2,我们开始提示今天的扩展不再工作了。我尝试在 iOS 8.1.2 设备上调试,甚至在扩展启动之前,它就崩溃并出现此错误:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: <__NSConcreteUUID 0x174027280> 5AFB07AB-5DCD-46FE-8D07-44DE0F3789F2)'

我读过这篇关于开发今天的扩展时经常发生的错误的帖子:http://www.atomicbird.com/blog/ios-app-extension-tip

Tom Harrington 在他的帖子中说:

In iOS 8 (and other recent versions), enabling modules in Xcode's build settings means you don't need to explicitly list all the frameworks you want to use. They'll be found automatically.

But this isn't the case with NotificationCenter.framework, which Today extensions use. If you remove that from the build settings, you won't get any build warnings or errors. But when you try to load the extension, you'll get an exception from libextension.dylib and your extension won't load. The exception message is not enlightening:

2014-08-16 12:06:53.793 TodayTestExtension[41313:6111763] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: object cannot be nil (key: <__NSConcreteUUID 0x7fd729422390> ED3B42F8-66CD-4CB0-BCD5-F3DBA6F34DB5)' If you're doing a today extension, just leave that framework in the build settings. It shouldn't need to be there, but it does.

我的扩展确实在其build设置中包含 NotificationCenter.framework,但我怀疑我的问题可能在某些方面类似。

有人遇到过类似的问题吗?知道如何解决吗?

最佳答案

如果您在“Info.plist”中使用 NSExtensionPrincipalClass 以使用不存在的 ViewController 名称定义基类(而不是使用 Storyboard),也会发生此错误。

使用 Swift 时,请确保在类前加上模块名称(通常是目标名称),例如“Module.MyViewController”。

关于ios - Today Extension 在 iOS 8.1.2 上启动前崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28153273/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com