iOS with Parse. PFUser.currentuser() not getting cached. Returns nil after app restart iOS with Parse. PFUser.currentuser() not getting cached. Returns nil after app restart swift swift

iOS with Parse. PFUser.currentuser() not getting cached. Returns nil after app restart


For me, the reason is simply the following part is not executed. Be careful of multi-thread. Usually that's the cause.

Parse.setApplicationId("xx","xx")


Are you sure you're not resetting the simulator and are running on the same one? It should not clear the currentUser.Is it possible you are calling

PFUser.logout()

in 'applicationWillTerminate' in AppDelegate or anywhere else?