We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when I update the entity first it works , but it failed when I update it again with different data;
Here is my code: // I called flowed function first , and it worked when I restart my app.
static func storeAuth( grantType:String, clientId:Int16, clientSecret:String ) -> Bool{ let auth = self.getUserAuth(); if auth == nil{ do{ try AppUser.db.operation({ (context, save) throws in let auth:UserAuth = try context.new(); auth.grantType = grantType; auth.clientId = clientId; auth.clientSecret = clientSecret try context.insert(auth) save() }) return true }catch{ debugPrint(error.localizedDescription) return false; } }else{ do{ try AppUser.db.operation({ (context, save) throws in auth?.grantType = grantType; auth?.clientId = clientId; auth?.clientSecret = clientSecret save() }) return true; }catch{ debugPrint(error.localizedDescription) return false; } } }
// and I call this function to update it again, but when I restart my app, the updated data was not stored. the data was that updated before;
static func updateAuthToken(expiresIn:Int, refreshToken:String, tokenType:String, accessToken:String){ let auth = self.getUserAuth(); if auth != nil{ do{ try AppUser.db.operation({ (context, save) throws in auth?.tokenExpiredAt = NSDate().addingSeconds(expiresIn) as NSDate? auth?.refreshToken = refreshToken auth?.tokenType = tokenType auth?.accessToken = accessToken save() }) }catch{ debugPrint(error.localizedDescription) } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What
when I update the entity first it works , but it failed when I update it again with different data;
Context
// and I call this function to update it again, but when I restart my app, the updated data was not stored. the data was that updated before;
The text was updated successfully, but these errors were encountered: