【发布时间】:2017-09-01 14:14:31
【问题描述】:
我正在尝试实现 Evernote,我需要登录并获取笔记本列表。我实现了以下代码..
ENSession *session = [ENSession sharedSession];
[[ENSession sharedSession] authenticateWithViewController:self preferRegistration:NO completion:^(NSError *authenticateError) {
if (authenticateError || !session.isAuthenticated) {
NSLog(@"Error : %@",authenticateError);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Could not authenticate"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
} else {
[self updateButtonsForAuthentication];
}
}];
- (void)updateButtonsForAuthentication
{
ENSession *session = [ENSession sharedSession];
if (session.isAuthenticated) {
[self showUserInfo];
} else {
}
}
- (void)showUserInfo
{
ENUserStoreClient *userStore = [[ENUserStoreClient alloc]init];
[userStore fetchUserWithCompletion:^(EDAMUser * user, NSError * _Nullable error) {
NSLog(@"%@",user);
NSLog(@"%@",user.username);
}];
}
在 Showuserinfo 方法中,我将 EDAMUser 设为 nil,我也想要所有笔记本列表。任何帮助都会很棒。
【问题讨论】:
-
谁能告诉我我哪里出错了..!?