Estoy en un problema con el intercambio de texto para evernote, compartir evernote es un éxito, pero esta es mi situación actual con el código. Tengo un UITableView
que tiene texto y título para ese texto correspondiente. Cuando se hace clic en el botón compartir, se comparte el texto onebyone al sitio web de evernote, pero el título permanece estático. Ahí recibo el primer nombre del título junto con texto diferente. Mi código de esto es en mi tableview en rowAtIndexPath
Anexando una cadena con una cadena en ios
NSMutableString *strr=[[NSMutableString alloc]initWithString:[appDelegate.indexArray objectAtIndex:indexPath.section]];
cell.textLabel.text =strr ;
cell.textLabel.text = [appDelegate.indexArray objectAtIndex:row];
cell.textLabel.font = [UIFont fontWithName:@"Georgia" size:14.0];
cell.textLabel.textColor = [UIColor brownColor];
[appDelegate.notesArray objectAtIndex:row]];
//cell.detailTextLabel.text =notes;
cell.detailTextLabel.font = [UIFont fontWithName:@"Georgia" size:14.0];
cell.detailTextLabel.textColor = [UIColor darkGrayColor];
cell.detailTextLabel.text = [appDelegate.notesArray objectAtIndex:row];
appDelegate.indexArray
es el contenido de títulos para cada celda y appDelegate.notesArray
tiene la textnote de los títulos correspondientes.
En ShareButton clic:
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];
ENML = [NSString stringWithFormat:@"%@%@", ENML, @"</en-note>"];
NSLog(@"%@", ENML);
// Adding the content & resources to the note
[note setContent:ENML];
Esto le dará al uno por uno carga de notetext.but por el título incluyo el código
NSMutableString *strtitle = [[NSMutableString alloc] initWithString:@"myBibleApp"];
for (int i = 0; i<[appDelegate.indexArray count];i++) {
NSString * aStringtitle = [[NSString alloc] initWithString:[appDelegate.indexArray objectAtIndex:i]] ;
/* NSString *ENMLtitle = [NSString stringWithFormat:@"%@%@", aStringtitle];
NSLog(@"%@", ENMLtitle);*/
note.title = aStringtitle;
Pero aquí está mi problema es el título y uplode texto en doble Eso significa que tengo un texto con título. Cuando hago clic en el botón Compartir, sube dos veces.1 = 2,2 = 4,3 = 6 así. Nuez solo agregando el título Obtengo este problema. Si pongo el título estático, note.title = @ "statictitle". No repetirá la carga. ¿Cómo puedo agregar la cadena de la manera correcta? Por favor, ayúdenme. Gracias de antemano.
haii, thaks para la respuesta, eliminé el primero del código. Me doy cuenta de que después de publicar esta pregunta. Y en el caso de la aplicaciónDelegate.notearray, funciona perfecto.pero cuando agrego appDelegate.indexArray duplica .¿alguna solución? – stackiphone
Agregue un 'NSLog (@" appDelegate.indexArray% @ ", [appDelegate.indexArray description]);' para ver el contenido. Tal vez ya contenga duplicados. –