Home > Mobile >  Ask how to clean out a model
Ask how to clean out a model

Time:10-06

Recently met a problem when doing the project, after the login user information is saved in the user model, makes the model after log out=nil, but in fact, this is just a fake logged on user token still exist, but there is no NSUserDefult inside, after restart the application, token disappear, how to solve this kind of situation, I would like to ask about for two or three weeks

CodePudding user response:

Do you need to elaborate on it? Read your narrative is I understand the needs of the token, can't really quit login, is that right? If so can you tell me the token is returned by the server or client?

CodePudding user response:

This token is given by the server stored in the local user information in such a model, in the operation of the log out, just let this model=nil, but as a matter of fact at the time of request interface, the client will still be attached to request token

CodePudding user response:

Token is the server to the you put a token into a property of the model, the model=nil haven't got the token request there will be no token
You said don't have my token NSUserDefult after that your request is token is which come of?

CodePudding user response:

Ric
reference 3 floor response:
token is that you write the model token server to an attribute, the model=nil haven't got the token request there will be no token
You said don't have my token NSUserDefult after that your request is token is which come of?

I later found out that token has been in existence for httpmanager a singleton, how to release this single case, it happened is a httpmanager

CodePudding user response:

Singleton cannot release, plus a interface to empty line
  •  Tags:  
  • iOS
  • Related