开发者

xcode+deselect the cell in tableviewcontroller

开发者 https://www.devze.com 2023-03-13 05:58 出处:网络
I had taken tableview in viewcontroller. Now I had wrote a code to navigate to other controller when particular row is selected.

I had taken tableview in viewcontroller. Now I had wrote a code to navigate to other controller when particular row is selected.

Example:-on selecting the 1st index user n开发者_运维知识库avigates ---> Tableview navigates to mapview

Now on clicking on back button on mapview user navigates ---> mapview to Tableview

Now the problem I am facing is when I navigate to tableview from mapview I can see the by default the 1st row selected.

And I want that when I navigates to tableview from mapview no row should be shown as selected.

What should I write and where so that no row by default is selected.


You'll want to be doing this in your didSelectRowAtIndexPath method:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
       [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号