0
哈II,是做具有共享注意選擇到Evernote我做它成功地一個應用程序,我有一個包含文本和上傳這些文本到Evernote一個按鈕的tableview,如果用戶單擊單元格的accsocory複選標記來了,他可以通過使用複選標記uploade.but我的問題是,當用戶點擊一個單元格,然後點擊上傳按鈕,將上傳行中的所有值不僅sectled行,但也是整個選擇的詩句行。 我的代碼是 Buttonclick:的UITableView didselectRowAtIndex懷疑
-(IBAction)sendNoteEvernote:(id)sender{
NSMutableString *str = [[NSMutableString alloc] initWithString:@"NOTES:"];
for (int i = 0; i<[appDelegate.notesArray count]; i++) {
// UPLOAD STRINGS HERE
if (selected[i])
[str appendFormat:@"%@ ,",[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>%@",str];
}
STR是上傳 代碼selectrowatindexpath值:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
NSUInteger row = [indexPath row];
selected[row] = !selected[row];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.accessoryType = selected[row] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
in.hi declate BOOLEAN selected;
在viewDidLoad中
for (int i=0; i<[appDelegate.notesArray count]; i++) {
selected[i] = YES;
}