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は値を返しません。非同期と呼ばれる内部API関数の1つでスタックします。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 に答える