要素Aが配列Bの中に存在するか調べるには in_array を使う。
以下の例では、配列Bの中に要素Aが存在するので「Got elementA」が出力されます。
$arrayB = array("elementA", "NT", "Irix", "Linux");
if (in_array("elementA", $arrayB)) {
echo "Got elementA";
}
//セルが選択された際に呼び出される – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //選択されたセルを取得 UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; //セルにチェックが付いている場合はチェックを外し、付いていない場合はチェックを付ける if (cell.accessoryType == UITableViewCellAccessoryCheckmark) { cell.accessoryType = UITableViewCellAccessoryNone; } else { cell.accessoryType = UITableViewCellAccessoryCheckmark; } }
この投稿へのコメント
コメントはまだありません。