ios - Xcode 中关于 iOS 中的 fenceExemptQueue 的奇怪警告

标签 ios

当我的应用进入后台时(在 applicationDidEnterBackground 之后),出现以下警告。

2015-12-11 20:54:43.661 AppName[759:124891]  *|synchronize-skip|* a fence was started inside of a snapshot block - skipping the workspace synchronize because it may dequeue messages from the fenceExemptQueue and snapshots expect that not to happen
2015-12-11 20:54:44.084 AppName[759:124891]  *|synchronize-skip|* a fence was started inside of a snapshot block - skipping the workspace synchronize because it may dequeue messages from the fenceExemptQueue and snapshots expect that not to happen

我在 Google 上找不到任何相关信息,也不知道为什么会这样。

有人知道这是什么意思吗?谢谢!

最佳答案

我在 Swift 程序中收到了同样奇怪的错误消息,最终弄清楚我的代码出了什么问题。正确的代码是:

    override func viewDidLoad() {
    super.viewDidLoad()

    let fileMgr = NSFileManager.defaultManager()
    ubiquityURL = fileMgr.URLForUbiquityContainerIdentifier(nil)

    guard ubiquityURL != nil else {
        print("Dave: Unable to access iCloud account")
        return
    }
    ubiquityURL = ubiquityURL?.URLByAppendingPathComponent("Documents/savefile.txt")

    metaDataQuery = NSMetadataQuery()
    metaDataQuery?.predicate = NSPredicate(format: "%K like 'savefile.txt'", NSMetadataItemFSNameKey)
    metaDataQuery?.searchScopes = [NSMetadataQueryUbiquitousDocumentsScope]
    NSNotificationCenter.defaultCenter().addObserver(self, selector: "metadataQueryDidFinishGathering:", name: NSMetadataQueryDidFinishGatheringNotification, object: metaDataQuery!)
    metaDataQuery!.startQuery()
}

在上面的代码中,正确的格式是“%K like 'savefile.txt'”,但是如果您忘记了文件名两边的单引号,您会收到奇怪的运行时错误消息。如果文件名周围没有单引号,元数据查询将无法在 iCloud 上找到您的文件。

关于ios - Xcode 中关于 iOS 中的 fenceExemptQueue 的奇怪警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34224169/

相关文章:

ios - 苹果的证书是什么?

ios - 对 EKEventStatus 感到困惑

ios - Swift 不识别这个特定的 Objective-C 类构造函数

ios - react native : Can you force refreshing the App or rerendering the page onPress of a button?

ios - 循环和编辑 UITextField 占位符不起作用

ios - 如何在 iOS 上调试 iOS EXC_BAD_ACCESS KERN_INVALID_ADDRESS

ios - 不显示所有用户的用户数据,如何只显示喜欢该登录用户的人的数据?

iphone - iOS 灰度/黑白

ios - NSKeyedUnarchiver。从 plist 加载自定义对象数组

iphone - UITextField 选择导致 UITableVIew 拉伸(stretch)