When my app is going to background (right after applicationDidEnterBackground
), the following warning appeared.
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
I cannot find any information about it on Google and have no idea why it is happening.
Does anyone know what it means? Thanks!
I got the same weird error message in a Swift program, and finally figured out what was wrong with my code. The correct code is:
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()
}
In the code above, the correct format is "%K like 'savefile.txt'", but if you forget the single quotes around the file name, you get the strange runtime error message. Without the single quote around the filename, the metadata query fails to find your file on iCloud.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With