選択した行を配列に追加しようとしています.2番目に選択した行をmyArrayに追加すると、最初のオブジェクトが2番目に置き換えられ、myArrayでオブジェクトを1つだけ取得するたびに次のようになります。テーブルdidSelectAtIndexPath:メソッドコード:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (cell.accessoryType == UITableViewCellAccessoryNone)
{
cell.accessoryType = UITableViewCellAccessoryCheckmark;
myArray = [[NSMutableArray alloc] init];
[myArray addObject:[Array1 objectAtIndex:indexPath.row]];
NSLog(@"myArray %@",myArray);
}
}
誰でも私を助けることができます。前もって感謝します