resolve issue in core data operations

This commit is contained in:
Bob Sun 2017-02-15 17:28:15 +08:00
parent 068f5be807
commit 8d474677da
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -137,7 +137,7 @@ class PasswordStore {
fm.enumerator(atPath: self.storeURL.path)?.forEach({ (e) in
if let e = e as? String, let url = URL(string: e) {
if url.pathExtension == "gpg" {
let passwordEntity = PasswordEntity(context: context)
let passwordEntity = NSEntityDescription.insertNewObject(forEntityName: "PasswordEntity", into: context) as! PasswordEntity
let endIndex = url.lastPathComponent.index(url.lastPathComponent.endIndex, offsetBy: -4)
passwordEntity.name = url.lastPathComponent.substring(to: endIndex)
passwordEntity.rawPath = "\(url.path)"