user1836180
user1836180

Reputation:

How to show detail in table view on xcode

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

Answers (1)

Kalpesh
Kalpesh

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

Related Questions