Posts

Post not yet marked as solved
0 Replies
460 Views
I'm working on creating a backup file for core data and stored locally in the device, but i have error: "The operation couldn’t be completed. (NSSQLiteErrorDomain error 5.)" Im getting this error after trying to restore my data. I ben searching a lot and trying different things but noting changes. Error Domain=NSSQLiteErrorDomain Code=5 "(null)" UserInfo={NSFilePath=/Users///////Library/Application Support/DataModel.sqlite, Source database Path=/Users///////Documents/Test.sqlite, reason=Failed to replace destination database} func restoreFromStore(backupName: String) { let container = NSPersistentContainer(name: "DataModel") let storeFolderUrl = FileManager.default.urls(for: .applicationSupportDirectory, in:.userDomainMask).first! let storeUrl = storeFolderUrl.appendingPathComponent("DataModel.sqlite") let backUpFolderUrl = FileManager.default.urls(for: .documentDirectory, in:.userDomainMask).first! let backupUrl = backUpFolderUrl.appendingPathComponent(backupName + ".sqlite") let description = container.persistentStoreDescriptions.first description?.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey) container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { print("err:\(error)") } container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy container.viewContext.automaticallyMergesChangesFromParent = true try? container.viewContext.setQueryGenerationFrom(.current) container.viewContext.transactionAuthor = kCGPDFContextAuthor as String do{ try container.persistentStoreCoordinator.replacePersistentStore(at: storeUrl, destinationOptions: nil, withPersistentStoreFrom: backupUrl, sourceOptions: nil, ofType: NSSQLiteStoreType) } catch { print("Failed to restore:\(error.localizedDescription)") } }) self.PassTable.reloadData() }
Posted
by juan luis.
Last updated
.
Post not yet marked as solved
1 Replies
444 Views
I have an app that uses Core Data but now I'm adding CloudKit to my app and I'm having issues on synchronising all the old Core Data. Does anyone have the same issue? Does anyone have any idea how to synchronise old Core Data?
Posted
by juan luis.
Last updated
.
Post not yet marked as solved
8 Replies
9.4k Views
Please help to understand how to answer "Export Compliance" questions. What people usually answer when submitting apps that using CommonCrypto and CloudKit1-) Have you added or made changes to encryption features since your last submission of this app?Export laws require that products containing encryption must be properly authorized for export. Failure to comply could result in severe penalties. Learn more about export requirements.YES or NO2-) Is your app designed to use cryptography or does it contain or incorporate cryptography? (Select Yes even if your app is only utilizing the encryption available in iOS or OS X.)YES or NOif question 2 YESDoes your app qualify for any of the exemptions provided in Category 5, Part 2 of the U.S. Export Administration Regulations?Make sure that your app meets the criteria of the exemption listed here. You are responsible for the proper classification of your product. Incorrectly classifying your app may lead to you being in violation of U.S. export laws and could make you subject to penalties, including your app being removed from the App Store. Read the FAQ thoroughly before answering the questions.You can select Yes for question #2 if the encryption of your app is:(a) Specially designed for medical end-use(b) Limited to intellectual property and copyright protection(c) Limited to authentication, digital signature, or the decryption of data or files(d) Specially designed and limited for banking use or "money transactions"; or(e) Limited to "fixed" data compression or coding techniquesYou can also select Yes if your app meets the descriptions provided in Note 4 for Category 5, Part 2 of the U.S. Export Administration Regulations.For additional guidance on exemptions, see the FAQ.YES or NO
Posted
by juan luis.
Last updated
.