Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to retain a UIView controller (ARC)
    primarykey
    data
    text
    <p>These 4 files are relevant to this post:</p> <p>The FirstViewController has a button (not on the nav bar, a separate button), when it is pressed, the page should curl up to present FilterViewController. </p> <p>FirstViewController.h</p> <pre><code>- (IBAction)searchOptions:(id)sender; </code></pre> <p>FirstViewController.m:</p> <pre><code>- (IBAction)searchOptions:(id)sender { FilterViewController *ctrl = [[FilterViewController alloc] initWithNibName:@"FilterViewController" bundle:nil]; [UIView transitionFromView:self.view toView:ctrl.view duration:1 options:UIViewAnimationOptionTransitionCurlUp completion:nil]; [self.navigationController pushViewController:ctrl animated:NO]; } </code></pre> <p>On FilterViewController it has some UI stuff, you press a button, it saves the UI stuff and then the page curls back down to show the FirstViewController.</p> <p>FilterViewController.h:</p> <pre><code>- (IBAction)backToMap:(id)sender; </code></pre> <p>FilterViewController.m:</p> <pre><code>- (IBAction)backToMap:(id)sender { FirstViewController *ctrl = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil]; [UIView transitionFromView:self.view toView:ctrl.view duration:1 options:UIViewAnimationOptionTransitionCurlDown completion:nil]; [self.navigationController popViewControllerAnimated:YES]; } </code></pre> <p>The issue here is with the retention of UIView. How can I retain the UIView?</p> <p>When I click the button on FirstViewController the animation works and the page is presented. However on FilterViewController when I click the button it crashes to the debugger with the error:</p> <p><strong>EXC_BAD_ACCESS(code=2,address=0x8)</strong></p> <p>In the output console it says: <code>(lldb)</code></p> <p>After the page curl up I have a stepper, when I click the stepper I get the same error in the debugger.</p> <p>UPDATE: I have tracked the memory location error: <a href="http://i.imgur.com/dL18H9Z.png" rel="nofollow">http://i.imgur.com/dL18H9Z.png</a></p> <p>Thanks.</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.
 

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