So I have a popup table view that displays 3 names. What I am trying to get is when a user selects a name from the popup table it will close the popup and display that name on a label or textfield on the original view controller. Here is what I have so far:
(selectedName is the name of the label I have on the original viewcontroller)
- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; selectedName.text = cell.textLabel.text; } Its not working and I am also looking for a way for the popup to disappear when a cell is clicked. Any ideas?
EDIT: (code for setting cell label text)
cell.textLabel.text = [[myArray objectAtIndex:indexPath.row] objectForKey:@"Name"];