amone
amone

Reputation: 3862

Why is EDAMNote.content is null?

I want to get the content of the first note in the notebook. I set a content and title. Title is ok but content attribute is null.

EDAMNoteFilter *filter = [[EDAMNoteFilter alloc] init];
[[EvernoteNoteStore noteStore] findNotesWithFilter:filter
                                                        offset:0
                                                      maxNotes:10
                                                       success:^(EDAMNoteList *result) {
                                                           if(result.totalNotes>0)
                                                           {

                                                               EDAMNote *note=result.notes[0];
                                                               NSLog(@"%@",[note title]);
                                                               NSLog(@"%@",[note content]);
                                                           }
                                                       }
                                                       failure:^(NSError *error) {

                                                           // FIXME:zxx 2012-9-26 Alert user error occurs
                                                           NSLog(@"Error occurs when retreiving notes: %@", error);
                                                       }];

Upvotes: 0

Views: 93

Answers (1)

Paulw11
Paulw11

Reputation: 115104

If you read the documentation for the findNotesWithFilter method in the Evernote SDK you will see the following -

Discussion

Used to find a set of the notes from a user’s account based on various criteria specified via a NoteFilter object.

The Notes (and any embedded Resources) will have empty Data bodies for contents, resource data, and resource recognition fields. These values must be retrieved individually.

You need to retrieve the content using a method such as getNoteWithGuid:withContent:withResourcesData:withResourcesRecognition:withResourcesAlternateData:success:failure:

Upvotes: 1

Related Questions