Skip to content

Commit 2c56933

Browse files
committed
Fixed realm data miss match issue
1 parent 28621a7 commit 2c56933

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

GoInfoGame/GoInfoGame/DataBase/DatabaseConnector.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,7 @@ class DatabaseConnector {
215215
@return StoredNode
216216
*/
217217
func getNode(id:Int) -> StoredNode? {
218-
let compoundId = "\(id)"
219-
return realm.object(ofType: StoredNode.self, forPrimaryKey: compoundId)
218+
return realm.object(ofType: StoredNode.self, forPrimaryKey: id)
220219
}
221220
/**
222221
Fetches single Way from the database
@@ -228,8 +227,7 @@ class DatabaseConnector {
228227
// }
229228

230229
func getWay(id: Int) -> StoredWay? {
231-
let compoundId = "\(id)"
232-
return realm.object(ofType: StoredWay.self, forPrimaryKey: compoundId)
230+
return realm.object(ofType: StoredWay.self, forPrimaryKey: id)
233231
}
234232

235233

0 commit comments

Comments
 (0)