崩溃:com.apple.root.default-qos [英] Crashed: com.apple.root.default-qos
问题描述
我有一个相当简单的应用程序,可以解析RSS feed并在表格视图中显示其内容.它可以在App Store上找到.我集成了Crashlytics故障报告.我最近收到了两份报告.这些有点难以解读.
I have a fairly simple app that parses a RSS feed and shows it's content in a table view. It's available on the App Store. I have Crashlytics crash reporting integrated. I recently received two reports. These are a little difficult to decipher.
这是在运行iOS 10.2.1的iPhone 6中发生的.
This has occurred in an iPhone 6 running iOS 10.2.1.
这是来自运行iOS 10.2.1的iPhone 5.
This is from an iPhone 5 running iOS 10.2.1.
即使它说它是由于侵犯隐私而崩溃的,我也没有访问任何需要在我的应用程序中获得许可的服务.
Even though it says it's crashing due to privacy violations, I'm not accessing any services that requires permission in my app.
也在 com.apple.root.default-qos 上搜索使我相信,这可能与后台线程有关.我使用后台线程的唯一地方是解析RSS feed数据.
Also searching on com.apple.root.default-qos lead me to believe that this may have something to do with background threads. The only place where I use a background thread is to parse the RSS feed data.
DispatchQueue.global(qos: .background).async {
guard let data = try? Data(contentsOf: URL) else {
return
}
do {
let xmlDoc = try AEXMLDocument(xml: data)
if let items = xmlDoc.root["channel"]["item"].all {
self.posts.removeAll()
for item in items {
let title = item["title"].value ?? ""
// ...
self.posts.append(jobPost)
}
DispatchQueue.main.async {
self.saveposts(self.posts)
self.posts.sort { $0.publishDate > $1.publishDate }
self.tableView.reloadData()
UIApplication.shared.toggleNetworkActivityIndicator(show: false)
self.toggleUI(enable: true)
if self.refreshControl.isRefreshing { self.refreshControl.endRefreshing() }
}
}
} catch let error as NSError {
print("RSS parsing failed: \(error)")
self.showErrorAlert(error)
UIApplication.shared.toggleNetworkActivityIndicator(show: false)
self.toggleUI(enable: true)
if self.refreshControl.isRefreshing { self.refreshControl.endRefreshing() }
}
}
我在运行iOS 9.3.5的iPhone 5和运行iOS 10.2的模拟器上测试了此代码,但没有发生崩溃.
I tested this code on my iPhone 5 running iOS 9.3.5 and simulators running iOS 10.2 but no crash occurred.
还有其他方法可以解决此问题吗?
Is there any other way to track down this problem?
推荐答案
我会仔细检查您所有的权限.以我为例,从iOS10开始,您需要权限才能将内容保存到用户的相机胶卷中.在我的应用程序中,我正在显示默认的共享表,每当用户选择保存照片"时,应用程序就会崩溃,并显示以下非常无用的错误消息之一.我添加了
I would double check all your permissions. In my case, starting with iOS10 you need permissions to save stuff to the user's camera roll. In my app, I was showing a default share sheet and whenever a user selected "save photo" the app crashed with one of these very not helpful error messages. I added
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Allow you to save charts and graphs from the app to your phone.</string>
到我的info.plist
,clean
& run
.一切都解决了.
to my info.plist
, clean
& run
. And everything the problem was solved.
这篇关于崩溃:com.apple.root.default-qos的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!