mercredi 25 mars 2015

objective c - dismiss uitabbarviewcontroller

I have implemented a simple login page, where the user logs in with valid credentials. I then set the NSUserDefauts and navigate them to the "HOME" screen. I'm now trying to implement a logout button.


Below is how return back to the login screen and clear my NSUserDefaults.



NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier];
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain];

[self dismissViewControllerAnimated:YES completion:nil];


Is this the correct way to implement a 'logout' functionality? I just want to make sure I implement the functionality correctly and not cause any memory leaks.




Aucun commentaire:

Enregistrer un commentaire