EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore];
EDAMNote *note = [[EDAMNote alloc] init];
[note setTitle:@"Test Note from EvernoteCounter for iPhone"];
[note setContent:[ [NSString alloc] initWithFormat:@"<en-note>%@</en-note>",@"tete"];
[noteStore createNote:(note) success:^(EDAMNote *note) {
NSLog(@"Received note guid: %@", [note guid]);
}failure:^(NSError *error) {
NSLog(@"Create note failed: %@", error);
}];
我使用此代码通过 Evernote 激活
createNote
,但 createNote
不返回任何值 - 它卡在名为 async 的内部 API 函数之一中。有没有人尝试使用 iOS SDK 上的 API 创建新笔记,并且实际上在他们的 Evernote 帐户上获得了该笔记?
我们刚刚添加了一些新的示例代码来创建照片笔记。请查看:https://github.com/evernote/evernote-sdk-ios。创建注释的正确方法是使用:
- (id) initWithGuid: (EDAMGuid) guid title: (NSString *) title content: (NSString *) content contentHash: (NSData *) contentHash contentLength: (int32_t) contentLength created: (EDAMTimestamp) created updated: (EDAMTimestamp) updated deleted: (EDAMTimestamp) deleted active: (BOOL) active updateSequenceNum: (int32_t) updateSequenceNum notebookGuid: (NSString *) notebookGuid tagGuids: (NSArray *) tagGuids resources: (NSArray *) resources attributes: (EDAMNoteAttributes *) attributes tagNames: (NSArray *) tagNames;
另请参阅:http://dev.evernote.com/documentation/reference/Types.html#Struct_Note 了解更多信息。
Sample code for u. @KatieK
// --------------------------------
EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore];
EDAMNote *note = [[EDAMNote alloc] init];
[note setTitle:@"Hello Evernote"];
[note setContent:[[NSString alloc] initWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\"><en-note>Hello, world! %@</en-note>",@"I'm LongPham"]];
[noteStore createNote:note success:^(EDAMNote *note) {
NSLog(@"Received note guid: %@", [note guid]);
}failure:^(NSError *error) {
NSLog(@"Create note failed: %@", error);
}];