Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. username = _userNameTF.text;
  2.  
  3. NSString * password= [[NSString alloc]init];
  4.  
  5.  
  6.  
  7. password = _passwordTF.text;
  8. NSLog(@"user name = %@",username);
  9. NSLog(@"Password = %@",password);
  10.  
  11.  
  12.  
  13. [PFUser logInWithUsernameInBackground:self.userNameTF.text password:self.passwordTF.text
  14. block:^(PFUser *user, NSError *error)
  15. {
  16.  
  17. if (user)
  18.  
  19. {
  20. UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"Success :)" message:@"Logged In Successfully" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
  21. [alert show];
  22. // Do stuff after successful login.
  23.  
  24. } else
  25. {
  26. NSString *errorString = [error userInfo][@"error"];
  27.  
  28.  
  29. UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@":( Something went wrong" message:errorString delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
  30. [alert show];
  31.  
  32. // The login failed. Check error to see why
  33. }}];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement