Mam problem z udostępnianiem tekstu do evernote, udostępnianie evernote to sukces, ale tutaj jest moja obecna sytuacja z kodem. Mam numer UITableView
, który ma trochę tekstu i tytułu dla odpowiedniego tekstu. Po kliknięciu przycisku udostępniania zostanie udostępniony tekst do strony internetowej evernote, ale tytuł pozostaje statyczny. Tam otrzymuję pierwszą nazwę tytułu wraz z innym tekstem. Mój kod to jest w moim tableview w rowAtIndexPath
Dodawanie ciągu znaków z ciągiem znaków w 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
jest zawartość tytuł dla każdej komórki i appDelegate.notesArray
ma textnote dla odpowiednich tytułów.
W shareButton kliknij:
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];
to da się jeden po drugim przesyłanie notetext.but o tytuł I to ten kod
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;
Ale tu jest mój problem to uplode tytuł i tekst w podwójnym. Oznacza to, że mam jeden tekst z tytułem. Kiedy klikam przycisk akcji, przesyła dwa razy.1 = 2,2 = 4,3 = 6 w ten sposób. Nakrętka tylko dodająca tytuł Mam ten problem. Jeśli wstawię tytuł static, note.title = @ "statictitle". Nie powtórzy przesyłania. Jak mogę dołączyć ciąg znaków we właściwy sposób? Proszę, pomóż mi. Z góry dzięki.
haii, thaks za odpowiedź, usuwam pierwszy z code.i zauważyć, że po tym wpisuję to pytanie.i w przypadku appDelegate.notearray, działa idealnie.Ale dodam appDelegate.indexArray to duplikaty .ne rozwiązanie? – stackiphone
Dodaj 'NSLog (@" appDelegate.indexArray% @ ", [appDelegate.indexArray opis]);', aby zobaczyć zawartość. Może już zawiera duplikaty. –