整个事情在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
汤姆·哈灵顿在他的帖子中说:
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.
我的扩展程序在其构建设置中包含NotificationCenter.framework,但我怀疑我的问题可能在某些方面类似.
任何人面临类似的问题?任何想法如何解决?
解决方法
当使用Swift时,请确保使用模块名称(通常是目标的名称)像“Module.MyViewController”一样在该类前面.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。