How do I know which row is currently selected in table view without using any global variable to store last clicked row using this method.
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You don’t need a global variable. if you need to track the currently selected row, you can create a member variable (iVar) in the class that is the delegate for the table view callbacks.
That method passes you the indexPath which has the row that was selected. If you want remember that for other function callbacks, then create a property or iVar in that class.
In header:
In implementation