Search code examples
objective-cuitableviewuipickerview

Didselect Method of table will not call for another row until one row action will not perform completely


give me suggestion which is related to table view selection action.

I have a view in which a table with 2 section having 2 and 3 rows.When first section 2nd row select then a picker view comes for selecting a value. similarly 2nd section each row having its picker view for selecting values.So when i am selecting a row the a picker view comes i want to make other rows didselect method will not call for rows meanwhile a picker view is showing on view and after selecting a value and done button pressed again user can select a row and picker view comes.


Solution

  • Use willDeselectRowAtIndexPath to return nil or the NSIndexPath. Like this :

    - (NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
        if ([myPickerView isHidden]) return indexPath;
        return nil;
    }