0

如何在表格视图中创建 10 行xcode并在单击它们时将详细信息显示为警报?

4

1 回答 1

1

您必须在didselectRowAtIndexPath方法中编写逻辑

arr是NSMutablearray..

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Detail"
                              message:[arr objectAtIndex:indexPath.row]
                              delegate: nil
                              cancelButtonTitle:@"OK"
                              otherButtonTitles:nil];
    [alert show];
}
于 2012-12-18T11:20:49.100 回答