xcode+deselect the cell in tableviewcontroller
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];
}
精彩评论