File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -921,7 +921,11 @@ public class CloudObject: NSObject {
921921
922922 var objectClass : CloudObject . Type
923923
924- objectClass = CloudApp . objectClassForTableName ( tableName)
924+ if let type = type {
925+ objectClass = type
926+ } else {
927+ objectClass = CloudApp . objectClassForTableName ( tableName)
928+ }
925929
926930 let object = objectClass. init ( tableName: tableName)
927931 object. document = NSMutableDictionary ( dictionary: dictionary as [ NSObject : AnyObject ] , copyItems: true )
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ public class CloudUser: CloudObject {
109109 // Save the user if he has been successfully logged in
110110 if ( response. status == 200 ) {
111111 if let doc = response. object as? NSMutableDictionary {
112+ self . resetModificationState ( )
112113 self . document = doc
113114 self . setAsCurrentUser ( )
114115 }
@@ -363,7 +364,7 @@ public class CloudUser: CloudObject {
363364 if let userDat = def. objectForKey ( " cb_current_user " ) as? NSData {
364365 if let doc = NSKeyedUnarchiver . unarchiveObjectWithData ( userDat) as? NSMutableDictionary {
365366
366- let user = CloudUser . cloudObjectFromDocumentDictionary ( doc, documentType: T . self)
367+ let user = T . cloudObjectFromDocumentDictionary ( doc, documentType: T . self)
367368
368369 self . currentUser = user as? T
369370
@@ -382,6 +383,7 @@ public class CloudUser: CloudObject {
382383 let data = NSKeyedArchiver . archivedDataWithRootObject ( self . document)
383384 def. setObject ( data, forKey: " cb_current_user " )
384385
386+ def. synchronize ( )
385387 }
386388
387389 public class func removeCurrentUser( ) {
You can’t perform that action at this time.
0 commit comments