I want to prevent users from making the same selection twice or more and just pushing and pushing the same view controller onto the stack
Share
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.
Try…
Create BOOL value, something like
BOOL isSelectionActive;
Then in –
(void)tableView:(UITableView
*)tableView didSelectRowAtIndexPath:(NSIndexPath
*)indexPath set the isSelectionActive=TRUE;-
Then, in – (NSIndexPath
*)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath
*)indexPath return nil if isSelectionActive is TRUE, otherwise
return the indexPath.
Before dismissing the pushed view.
set isSelectionActive=False. You can
do this by passing in a reference to
the viewController that is pushing
the new view. And setting isSelectionActive=FALSE before dismissing the view.
or
in viewWillAppear, which will get
called when you dismiss the pushed
view.