iOS禁止多点操作(按钮和Table项)

1)避免同时点击多个按钮;

    [btn setExclusiveTouch:YES];

     设置确保当btn点击时,其他按钮不响应;

 

(2)避免同时点击UITableView中多个row

-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath

{

    if ([tableView indexPathForSelectedRow] != nil)  //如果已经选定某cell,则不允许同时选择另一Cell。

        return nil;

    else

        return indexPath;

}

posted @ 2014-12-30 11:27  Milo_D  阅读(537)  评论(0编辑  收藏  举报