Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I return to a view without creating repeating versions of the same view?
    primarykey
    data
    text
    <p>I have a split view where the top section of my split shows some questions, and the bottom section shows some other stuff. The problem is that I had it written to "push" to a new view every time the user selects a question. This is obviously less than ideal because the user can enter a situation where they have 15 copies (more or less, depending on how many times the user selects a question) of the same question to go back through.</p> <p>I thought that a simple solution would be to set a BOOL for when a user selects a question, but as it turns out, this introduces a new bug where the user can select a question once, but if they go back they are out of luck. I'm kind of stuck here, and any guidance would be greatly appreciated.</p> <p>Program flow:</p> <p>First you need to understand a little about what I am trying to do. I am building a historical inquiry app that focuses on allowing teachers to support student learning of historical inquiry. As such, there are core questions as well as documents the students can analyze.</p> <p>Based on the way the app has come along, JSLDetailViewController displays the core questions and JSL_QuestionInteraction displays the questions for analyzing the documents.</p> <p>Relevant code snippet:</p> <pre><code>-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if(indexPath.section == 0){ if(!didSelectQuestion){ [self performSegueWithIdentifier:@"questionDisplaySegue" sender:indexPath]; didSelectQuestion = TRUE; } else { JSLDetailViewController *detailView = [JSLDetailViewController alloc]; detailView.telegram = indexPath.row; [detailView setDetailItem:indexPath]; } }else if(indexPath.section == 1){ [self performSegueWithIdentifier:@"telegramQuestionDisplaySegue" sender:indexPath]; JSL_QuestionInteraction *questionView = [[JSL_QuestionInteraction alloc] init]; questionView.managedObjectContext = self.managedObjectContext; } } -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if([segue.identifier isEqualToString:@"questionDisplaySegue"]){ JSLDetailViewController *detailView = (JSLDetailViewController *)segue.destinationViewController; detailView.telegram = index.row; [detailView setDetailItem:index]; JSLDetailViewController *controller = (JSLDetailViewController *)segue.destinationViewController; controller.managedObjectContext = self.managedObjectContext; } else if ([segue.identifier isEqualToString:@"telegramQuestionDisplaySegue"]){ JSL_QuestionInteraction *questionView = [[JSL_QuestionInteraction alloc] init]; questionView.managedObjectContext = self.managedObjectContext; } } </code></pre> <p>Please let me know if you need any additional details to understand this problem.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload