Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- self.authenticationOperation = [ApplicationDelegate.mainAuthenticator
- authenticateWithUser:[usernameTextField text]
- withPassword:[passwordTextField text]];
- NSString *responseData = [self.authenticationOperation responseString];
- // This prints nothing at all, and I can't see anything with breakpoints.
- // Only meaningless characters.
- NSLog(@"RESPONSE: %@", responseData);
- if ([responseData isEqualToString:@"2"]) {
- UIAlertView *inactiveSyntaxAlert=[[UIAlertView alloc]
- initWithTitle:@"Login status"
- message:@"Log in is unavailable. Please confirm your e-mail adress."
- delegate:self cancelButtonTitle:@"I did, let me try again"
- otherButtonTitles:nil, nil, nil];
- [inactiveSyntaxAlert show];
- }
- else if([responseData isEqualToString:@"1"]) {
- NSLog(@"Login SUCCESS");
- UIAlertView *successSyntaxAlert=[[UIAlertView alloc]
- initWithTitle:@"Login status" message:@"Logged in successfully"
- delegate:self
- cancelButtonTitle:@"Thanks"
- otherButtonTitles:nil, nil, nil];
- [successSyntaxAlert show];
- } else {
- NSLog(@"Login FAILED");
- UIAlertView *failureSyntaxAlert=[[UIAlertView alloc]
- initWithTitle:@"Login status"
- message:@"Log in failed"
- delegate:self
- cancelButtonTitle:@"Ok"
- otherButtonTitles:nil, nil, nil];
- [failureSyntaxAlert show];
- }
- NSString *responseData = [self.authenticationOperation
- responseStringWithEncoding:NSASCIIStringEncoding];
- NSLog(@"RESPONSE: %@", responseData);
- -(NSString*)responseString {
- return [self responseStringWithEncoding:self.stringEncoding];
- }
- -(NSString*) description {
- NSMutableString *displayString = [NSMutableString stringWithFormat:@"%@nRequestn-------n%@",
- [[NSDate date] descriptionWithLocale:[NSLocale currentLocale]],
- [self curlCommandLineString]];
- NSString *responseString = [self responseString];
- if([responseString length] > 0) {
- // THIS IS WHERE THE RESPONSE IS.
- // According to this responseString is what I need.
- // Still there seems I am doing something wrong because
- // I can't get the value on MY code.
- [displayString appendFormat:@"n--------nResponsen--------n%@n", responseString];
- }
- return displayString;
- }
Add Comment
Please, Sign In to add comment