i have a note which can share it to evernote,i done it sucessfully.but there is an option called import note.when we tap the import button the notes fromn the evernote has to load in the importpage textview.but my problewm is the note from the evernote appers in xml formate with the note.my code for uploding note to evernote server is
-(IBAction)sendNoteEvernote:(id)sender{
EDAMNote * note = [[[EDAMNote alloc] init]autorelease];
// Setting initial values sent by the user
note.title = @"mybibleapp";
NSMutableString *str = [[NSMutableString alloc] initWithString:@"NOTES:"];
for (int i = 0; i<[appDelegate.notesArray count]; i++) {
NSString * aString = [[NSString alloc] initWithString:[appDelegate.notesArray objectAtIndex:i]] ;
NSString * ENML= [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">\n<en-note>%@",aString];
//aString contains the note value
ENML = [NSString stringWithFormat:@"%@%@", ENML, @"</en-note>"];
NSLog(@"%@", ENML);
// Adding the content & resources to the note
[note setContent:ENML];
@try {
[[Evernote sharedInstance] createNote:note];
_acteverbackup.hidden = YES;
_actimageeverbackup.hidden =YES;
}
@catch (EDAMUserException * e) {
_acteverbackup.hidden = YES;
_actimageeverbackup.hidden =YES;
NSString * errorMessage = [NSString stringWithFormat:@"Error saving note: error code %i", [e errorCode]];
proAlertView *alert = [[proAlertView alloc]initWithTitle:@"Evernote" message:errorMessage delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert setBackgroundColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0] withStrokeColor:[UIColor colorWithHue:0.0 saturation:0.0 brightness:0.0 alpha:1.0]];
[alert show];
[alert release];
return;
}
i get the note in the everrnote correctly
this is my download or import code
- (void)viewDidLoad
{
[super viewDidLoad];
// Load the EDAMNote object that has guid we have stored in the object
EDAMNote * note = [(Evernote *)[Evernote sharedInstance] getNote:guid];
noteNavigation.topItem.title = [note title];
noteContent.text = [note content];
//noteContent is the textview which display the note
// Adding a back button to close the windows
UIBarButtonItem* doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(goBack:)];
UINavigationItem *item = [[[UINavigationItem alloc] init] autorelease];
item.leftBarButtonItem = doneButton;
item.hidesBackButton = YES;
[noteNavigation pushNavigationItem:item animated:NO];
noteNavigation.topItem.title = [note title];
}
noteContent is the textview which display the note ,here am getting this values
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">\n<en-note>%@",mynote is here</en-note>
i need only mynote is here in this textview. How can I separate this from note?
There’s a very nice NSString category that you can use, it’s a part of the project MWFeedParser. More specifically, you look for the file NSString+HTML.
The NSString+HTML category now supports XML decoding, you can read about it here.
This category adds to following methods to the NSString class
You should be able to transform XML into an NSString in a smart way by using it.
Hope it helps!