You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import SwiftyJSON
import Realm
import RealmSwift
class OfficeModel: Object {
var id = RealmOptional<Int>()
@objc dynamic var city: String?
@objc dynamic var address: String?
@objc dynamic var phone: String?
@objc dynamic var coordinate: OfficeСoordinates?
convenience init(json: JSON) {
self.init()
self.id.value = json["Id"].int
self.city = json["City"].string
self.address = json["Address"].string
self.coordinate = OfficeСoordinates(json: json["Coordinates"])
}
}
class OfficeСoordinates: Object {
var latitude = RealmOptional<Double>()
var longitude = RealmOptional<Double>()
convenience init(json: JSON) {
self.init()
self.latitude.value = json["Latitude"].double
self.longitude.value = json["Longitude"].double
}
}
The first time you access realm, the following error occurs:
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=1 "Schema validation failed due to the following errors:
Property 'OfficeModel.coordinate' of type 'object' has unknown object type 'OfficeСoordinates'" UserInfo={NSLocalizedDescription=Schema validation failed due to the following errors:
Property 'OfficeModel.coordinate' of type 'object' has unknown object type 'OfficeСoordinates', Error Code=1}: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-900.0.74.1/src/swift/stdlib/public/core/ErrorType.swift, line 181
2017-12-21 13:19:05.559834+0500 EnergoIndividual[73534:5337172] Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=1 "Schema validation failed due to the following errors:
Property 'OfficeModel.coordinate' of type 'object' has unknown object type 'OfficeСoordinates'" UserInfo={NSLocalizedDescription=Schema validation failed due to the following errors:
Property 'OfficeModel.coordinate' of type 'object' has unknown object type 'OfficeСoordinates', Error Code=1}: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-900.0.74.1/src/swift/stdlib/public/core/ErrorType.swift, line 181
The text was updated successfully, but these errors were encountered:
mrfer
changed the title
Crash: Property 'OfficeModel.coordinate' of type 'object' has unknown object type 'OfficeСoordinates
Problem in creating relationship one-to-one
Dec 22, 2017
The underlying cause here is your use of Unicode codepoint 0421, CYRILLIC CAPITAL LETTER ES, in place of the uppercase C in the type name of OfficeСoordinates. Replacing that with a normal Latin C fixes the problem.
Good day!
I have two classes:
The first time you access realm, the following error occurs:
![2017-12-21 13 19 25](https://user-images.githubusercontent.com/19203699/34246764-bff345e0-e651-11e7-8427-0099923805db.png)
2017-12-21 13:19:05.559834+0500 EnergoIndividual[73534:5337172] Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=1 "Schema validation failed due to the following errors:
Declared the property @objc dynamic var coordinate: OfficeСoordinates? as indicated on this page: https://realm.io/docs/swift/latest/#using-the-realm-framework
Tell me, please, what is the error here?
Realm framework version: 3.0.2
Realm Object Server version: n/a
Xcode version: 9.1
iOS/OSX version: iOS11
Dependency manager + version: Cocoapods 1.3.1
The text was updated successfully, but these errors were encountered: