OSDN Git Service
(root)
/
kcd
/
KCD.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Doutaku を 1.0 にアップデート
[kcd/KCD.git]
/
KCD
/
KCManagedObject.swift
diff --git
a/KCD/KCManagedObject.swift
b/KCD/KCManagedObject.swift
index
82d968b
..
e669ea4
100644
(file)
--- a/
KCD/KCManagedObject.swift
+++ b/
KCD/KCManagedObject.swift
@@
-8,6
+8,7
@@
import Foundation
import CoreData
import Foundation
import CoreData
+import Doutaku
enum KCManagedObjectError: Error {
enum KCManagedObjectError: Error {
@@
-37,7
+38,10
@@
class KCManagedObject: NSManagedObject {
if KCManagedObject.intValueKyes.contains(key) {
if KCManagedObject.intValueKyes.contains(key) {
- if let _ = value.pointee as? Int { return }
+ if let _ = value.pointee as? Int {
+
+ return
+ }
if let s = value.pointee as? String {
value.pointee = Int(s) as AnyObject?
if let s = value.pointee as? String {
value.pointee = Int(s) as AnyObject?
@@
-53,16
+57,19
@@
class KCManagedObject: NSManagedObject {
override func value(forUndefinedKey key: String) -> Any? {
override func value(forUndefinedKey key: String) -> Any? {
- if key == "description" { return value(forKey: "description_") }
+ if key == "description" {
+
+ return value(forKey: "description_")
+ }
if key.hasPrefix("api_") {
if key.hasPrefix("api_") {
-
/* MARK: CONVERT */
let k = String(key[key.index(key.startIndex, offsetBy: 4)...])
+ let k = String(key[key.index(key.startIndex, offsetBy: 4)...])
return value(forKey: k)
}
return value(forKey: k)
}
- print("Entity \(
type(of: self).entityName
) dose not have key \(key)")
+ print("Entity \(
String(describing: self)
) dose not have key \(key)")
return nil
}
return nil
}
@@
-78,12
+85,12
@@
class KCManagedObject: NSManagedObject {
if key.hasPrefix("api_") {
if key.hasPrefix("api_") {
-
/* MARK: CONVERT */
let k = String(key[key.index(key.startIndex, offsetBy: 4)...])
+ let k = String(key[key.index(key.startIndex, offsetBy: 4)...])
setValue(value, forKey: k)
return
}
setValue(value, forKey: k)
return
}
- print("Entity \(
type(of: self).entityName
) dose not have key \(key)")
+ print("Entity \(
String(describing: self)
) dose not have key \(key)")
}
}
}
}