Advertisement
Guest User

Untitled

a guest
Nov 8th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. 2016-11-08 08:53:43.919 iOSRealm[2629:65667] Sync: Connection[1]: Session[1]: Bad changeset received: Assertion failed: left().nullable == right().nullable
  2.  
  3. private func synchronouslyLogInUser() throws {
  4. SyncUser.authenticateWithCredential(Credential.usernamePassword(username, password: password, actions:.UseExistingAccount), authServerURL: authURL) { (user, error) in
  5. print("sent login request")
  6. if let user = user {
  7. print("user was not nil")
  8. self.setDefaultRealmConfiguration(user)
  9. }
  10. if let error = error where error.code == SyncError.HTTPStatusCodeError.rawValue && (error.userInfo["statusCode"] as? Int) == 400 {
  11. print("invalid user and pass")
  12. } else {
  13. print(error)
  14. }
  15. }
  16. }
  17.  
  18. private func setDefaultRealmConfiguration(user: SyncUser) {
  19. Realm.Configuration.defaultConfiguration = Realm.Configuration(syncConfiguration: (user, realmURL), objectTypes: [Weather.self, Wind.self])
  20. Realm.Configuration.defaultConfiguration.deleteRealmIfMigrationNeeded = true
  21. realm = try! Realm()
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement