こんにちは、iOS のデフォルト アラームに関連するアプリを作成しています。tableView で複数のセルを選択しています。戻るボタンをクリックすると、選択したセルが別のビューのラベルとして tableViewCell に表示されます。ストーリーボードを使用しています。これを行う方法?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *thisCell = [tableView cellForRowAtIndexPath:indexPath];
if (thisCell.accessoryType == UITableViewCellAccessoryNone) {
thisCell.accessoryType = UITableViewCellAccessoryCheckmark;
[myIndexArray addObject:[NSString stringWithFormat:@"%d",indexPath.row]];
}
else
{
thisCell.accessoryType = UITableViewCellAccessoryNone;
for(int i=0; i<myIndexArray.count; i++)
{
if([[myIndexArray objectAtIndex:i]intValue]== indexPath.row)
{
[myIndexArray removeObjectAtIndex:i];
break;
}
}
}
}
リピートビューのようなものが欲しいので、戻るボタンを押して、選択したセルをリピートテーブルビューセルに表示します。