テーブルビューがあり、特定のセルを押すと、各セルのパーソナライズされたデータを含むアラートビューが表示されます。これはコードです:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *message=[NSString stringWithFormat:@"%@", [tableViewData objectAtIndex:indexPath.row]];
if (message == @"Juan") {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Alerta" message:@"Ciudad de México" delegate:self cancelButtonTitle:@"Cerrar" otherButtonTitles:nil];
[alert show];
}
}
JuanがUIAlertViewを表示していることを示すセルを押すと、別のセルを押すとPedro UIAlertViewが表示され、セルごとにセルを押してもアラートビューに表示されない場合は間違っています。からおよびを通して。