我正在尝试为直接针对EventKit的代码编写单元测试。这需要info.plist条目来描述需要访问日历的原因,就像您需要为相机访问,GPS等所做的那样。
我已经为测试目标info.plist添加了相应的条目,但是我收到了运行时错误:
2016-10-13 20:07:18.477916 myapp[18252:6774056] [access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCalendarsUsageDescription key with a string value explaining to the user how the app uses this data
如上所述here,似乎单元测试在线束中运行。但是测试项目确实得到了一个info.plist文件,但它不是“主要”的info.plist。有没有办法解决这个问题?人们如何测试与EventKit对话的代码或者位置是否有效?