Objective c 如何在xcode上的表视图中显示详细信息

Objective c 如何在xcode上的表视图中显示详细信息,objective-c,uitableview,Objective C,Uitableview,如何在xcode上的表视图中创建10行,并在单击它们时将详细信息显示为警报?您必须在didselectrowatinexpath方法中编写逻辑 arr是NSMutablearray - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"

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

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

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];
}
这是一个很好的教程