Trying to retrieve the contents of UITableView cell on selection by user?

The method only passes you the index number of whatever datasource you gave it, so refer it back to the datasource you used for the UITableView cells (I expect an NSArray) The relevant code should be yourItemsArray objectAtIndex:indexPath. Row Edit: (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSString *key = keys objectAtIndex:indexPath. Section; NSArray *nameSection = names objectForKey:key; NSString *rowTitle = nameSection objectAtIndex:indexPath.

Row; NSLog(@"rowTitle = %@", rowTitle); tableView deselectRowAtIndexPath:indexPath animated:YES; }.

The method only passes you the index number of whatever datasource you gave it, so refer it back to the datasource you used for the UITableView cells (I expect an NSArray). The relevant code should be yourItemsArray objectAtIndex:indexPath. Row; Edit: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSString *key = keys objectAtIndex:indexPath.

Section; NSArray *nameSection = names objectForKey:key; NSString *rowTitle = nameSection objectAtIndex:indexPath. Row; NSLog(@"rowTitle = %@", rowTitle); tableView deselectRowAtIndexPath:indexPath animated:YES; }.

Thanks for the reply, but unfortunately it hasn't solved it - I think the problem is related to the fact the . Plist is broken up into sections, so I first need to point out the section, then the row within it. I don't know whats worse - not knowing what I need to do, or knowing what I need to do but not knowing how to do it!

O_o – Chubsta Apr 8 '10 at 7:43 Sorry, I'm unable to read that code (use code tag, pastebin, whatever). If you just need the section index consider indexPath.section. – handfix Apr 8 '10 at 8:25 thanks for the reply, I was looking at 'section' as that made all the sense in the world - get the section detaials, get the row details - this all points to the correct string in the array, and I should be able to get the string from it... sounds simple, but ive got a mental block on it... (i have reformatted the code if you could perhaps take a look at it again for me... thanks, karl – Chubsta Apr 8 '10 at 9:45 Thanks so much for the help - I had actually started to mess with NSLog but my syntax wasnt right and I wasnt really getting anywhere.. I also understand how the code works that you have given me so it has been a very good learning process for me Cheers, Karl This has solved the problem and gives me the information I need to move onwards and upwards – Chubsta Apr 8 '10 at 18:32.

I have set it up so I get an alert with the results of the button press and it is here that I want to see the contents of the cell being produced. Instead of the expected string eg. "data line 1", all I get is the number of the row within the section.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions