Skip to content

Instantly share code, notes, and snippets.

Created August 12, 2011 10:41
Show Gist options
  • Save anonymous/1141838 to your computer and use it in GitHub Desktop.
Save anonymous/1141838 to your computer and use it in GitHub Desktop.
@try {
if (versionOk == YES)
{
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:username.text forKey:@"username"];
[userDefaults synchronize];
[userDefaults setObject:password.text forKey:@"password"];
[userDefaults synchronize];
NSString *usernameString1 = [userDefaults stringForKey:@"username"];
NSString *passwordString1 = [userDefaults stringForKey:@"password"];
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