Alex Alex - 1 year ago 67
iOS Question

Selected Index of UI Cell

I am new to iOS programming
I would like to Save the Selected

Cell (cell.detailTextLabel.text)
to another
outside of table view in the same
Can anyone suggest me how?

Answer Source

Use this delegate method of the table view,

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    selectedLabelName = cell.textLabel.text;

declare variable name selectedLabelName in your viewcontroller