Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. -(void)checkLoginStatus
  2. {
  3. NSUserDefaults *pref=[NSUserDefaults standardUserDefaults];
  4. NSString *userId=[pref objectForKey:@"user_id"];
  5. if(userId!=nil)
  6. {
  7. UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Already Logged in!" message:@"You are already logged in." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
  8. [alert show];
  9. UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:
  10. @"Main_iPhone" bundle:[NSBundle mainBundle]];
  11. PasswordVC*password = [mainStoryboard instantiateViewControllerWithIdentifier: @"invite"];
  12. [self presentViewController:password animated:YES completion:nil];
  13.  
  14. }
  15. else{
  16. UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"please log in first!" message:@"You are not logged in." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
  17. [alert show];
  18.  
  19.  
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement