File tree 2 files changed +8
-2
lines changed
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 {
921
921
922
922
var objectClass : CloudObject . Type
923
923
924
- objectClass = CloudApp . objectClassForTableName ( tableName)
924
+ if let type = type {
925
+ objectClass = type
926
+ } else {
927
+ objectClass = CloudApp . objectClassForTableName ( tableName)
928
+ }
925
929
926
930
let object = objectClass. init ( tableName: tableName)
927
931
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 {
109
109
// Save the user if he has been successfully logged in
110
110
if ( response. status == 200 ) {
111
111
if let doc = response. object as? NSMutableDictionary {
112
+ self . resetModificationState ( )
112
113
self . document = doc
113
114
self . setAsCurrentUser ( )
114
115
}
@@ -363,7 +364,7 @@ public class CloudUser: CloudObject {
363
364
if let userDat = def. objectForKey ( " cb_current_user " ) as? NSData {
364
365
if let doc = NSKeyedUnarchiver . unarchiveObjectWithData ( userDat) as? NSMutableDictionary {
365
366
366
- let user = CloudUser . cloudObjectFromDocumentDictionary ( doc, documentType: T . self)
367
+ let user = T . cloudObjectFromDocumentDictionary ( doc, documentType: T . self)
367
368
368
369
self . currentUser = user as? T
369
370
@@ -382,6 +383,7 @@ public class CloudUser: CloudObject {
382
383
let data = NSKeyedArchiver . archivedDataWithRootObject ( self . document)
383
384
def. setObject ( data, forKey: " cb_current_user " )
384
385
386
+ def. synchronize ( )
385
387
}
386
388
387
389
public class func removeCurrentUser( ) {
You can’t perform that action at this time.
0 commit comments