-
-
Save pratikshabhisikar/1141852 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@try { | |
if (versionOk == YES) | |
{ | |
NSLog(@"Before Saving - Username: %@ and Password: %@", username.text, password.text); | |
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; | |
[userDefaults setObject:username.text forKey:@"username"]; | |
[userDefaults synchronize]; | |
[userDefaults setObject:password.text forKey:@"password"]; | |
[userDefaults synchronize]; | |
NSString *usernameString1 = [[NSUserDefaults standardUserDefaults] objectForKey:@"username"]; | |
NSString *passwordString1 = [[NSUserDefaults standardUserDefaults] objectForKey:@"password"]; | |
NSLog(@"Before Saving - Username: %@ and Password: %@", usernameString1, passwordString1); | |
EDAMAuthenticationResult* authResult = [userStore authenticate:usernameString1 :passwordString1 :@"widevision-1247" : @"5065431cce534618"]; | |
user = [authResult user]; | |
authToken = [authResult authenticationToken]; | |
NSLog(@"Authentication was successful for: %@", [user username]); | |
NSLog(@"Authentication token: %@", authToken); | |
EvernoteViewController *evernotebook = [[EvernoteViewController alloc] initWithNibName:@"EvernoteViewController" bundle:nil]; | |
evernotebook.authToken = authToken; | |
evernotebook.noteStorebaseUri = noteStoreUriBase; | |
evernotebook.user =user; | |
[self.navigationController pushViewController:evernotebook animated:YES]; | |
[evernotebook release]; | |
} | |
} | |
@catch (NSException *ex) { | |
UIAlertView *alert = [[UIAlertView alloc] | |
initWithTitle:[ex name] | |
message:[ex reason] | |
delegate:self | |
cancelButtonTitle:@"OK" | |
otherButtonTitles: nil]; | |
[alert show]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment