在 tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath 我插入了一个 alertView ,其中包含一个文本,该文本根据单击的单元格而变化..
按钮“发送”nell'alertView 的操作必须保存所选单元格中存在的标签内容。
PS 我正在使用 Parse.com
到目前为止一切正常,但我只有一个问题,保存的数据不正确,因为它们不是所选单元格的数据,而是表格视图中第一个单元格的数据......我没有保存更多..只有这个..
Nell'IndexPath' 做错了什么?你能帮我识别选中的单元格all'alertview吗?
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    if ( buttonIndex ==0) {
        NSLog(@"ritorno");
    }
    else {
        NSArray *indexes = [self.TableView indexPathsForSelectedRows];
        for (NSIndexPath *indexPath in indexes) {
            PFUser *user = [self.Utenti objectAtIndex:indexPath.row];
            PFObject *RichiestaAmicizia = [PFObject objectWithClassName:FF_AMICIZIE_CLASS];
            [RichiestaAmicizia setObject:[PFUser currentUser] forKey:FF_AMICIZIE_DA_USER];
            [RichiestaAmicizia setObject:user forKey:FF_AMICIZIE_A_USER];
            [RichiestaAmicizia setObject:@"In_Attesa" forKey:FF_AMICIZIE_STATO];
            [RichiestaAmicizia saveInBackground];
        }
   NSLog(@"Send");
}
}