Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- username = _userNameTF.text;
- NSString * password= [[NSString alloc]init];
- password = _passwordTF.text;
- NSLog(@"user name = %@",username);
- NSLog(@"Password = %@",password);
- [PFUser logInWithUsernameInBackground:self.userNameTF.text password:self.passwordTF.text
- block:^(PFUser *user, NSError *error)
- {
- if (user)
- {
- UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"Success :)" message:@"Logged In Successfully" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
- [alert show];
- // Do stuff after successful login.
- } else
- {
- NSString *errorString = [error userInfo][@"error"];
- UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@":( Something went wrong" message:errorString delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
- [alert show];
- // The login failed. Check error to see why
- }}];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement