tags:

views:

22

answers:

2

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

A: 

That is very little information. :) But you could

a) check if the view controller is already there

b) suppress user selecting the same selection (from the information you supplied it is impossible to tell you how you should go about that)

Joseph Tura
A: 

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

  • You can set isSelectionActive = TRUE in viewWillAppear, which will get called when you dismiss the pushed view.

Jordan