Странное предупреждение в Xcode о 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 и не знаю, почему это происходит.

Кто-нибудь знает, что это значит? Спасибо!

Ответы

Ответ 1

В программе 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 нравится" savefile.txt ", но если вы забудете одинарные кавычки вокруг имени файла, вы получите странное сообщение об ошибке выполнения. Без единой цитаты вокруг имени файла запрос метаданных не сможет найти ваш файл в iCloud.