3
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 帐户中获得了笔记?

4

2 回答 2

0

我们刚刚添加了一些新的示例代码来创建照片笔记。请查看: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了解更多信息。

于 2012-12-12T16:35:22.363 回答
0
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);
    }];
于 2013-05-10T10:45:13.760 回答