Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2016-11-08 08:53:43.919 iOSRealm[2629:65667] Sync: Connection[1]: Session[1]: Bad changeset received: Assertion failed: left().nullable == right().nullable
- private func synchronouslyLogInUser() throws {
- SyncUser.authenticateWithCredential(Credential.usernamePassword(username, password: password, actions:.UseExistingAccount), authServerURL: authURL) { (user, error) in
- print("sent login request")
- if let user = user {
- print("user was not nil")
- self.setDefaultRealmConfiguration(user)
- }
- if let error = error where error.code == SyncError.HTTPStatusCodeError.rawValue && (error.userInfo["statusCode"] as? Int) == 400 {
- print("invalid user and pass")
- } else {
- print(error)
- }
- }
- }
- private func setDefaultRealmConfiguration(user: SyncUser) {
- Realm.Configuration.defaultConfiguration = Realm.Configuration(syncConfiguration: (user, realmURL), objectTypes: [Weather.self, Wind.self])
- Realm.Configuration.defaultConfiguration.deleteRealmIfMigrationNeeded = true
- realm = try! Realm()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement