Reputation:
How can I create 10 rows in a table view on xcode
and show a detail as alert when I click on them?
Upvotes: 0
Views: 185
Reputation: 5334
You have to write Logic in didselectRowAtIndexPath
Method
arr is 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];
}
Upvotes: 1