Created
August 12, 2011 10:41
-
-
Save anonymous/1141838 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) | |
{ | |
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