Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>typical model view controller behavior would suggest that you dismiss the modal view controller from the calling view controller rather than from self. not a hard and fast rule, but good practice.</p> <p>to accomplish this, create a protocol:</p> <pre><code> @protocol MyModalViewControllerDelegate - (void)modalViewControllerDidFinish; @end </code></pre> <p>and make both the parentViewController and FirstModalViewController be implemntors of this protocol.</p> <pre><code> @interface FirstModalViewController &lt;MyModalViewControllerDelegate&gt; </code></pre> <p>then in both FirstModalViewController.h and SecondModalViewController.h, add:</p> <pre><code> @property id&lt;MyModalViewControllerDelegate&gt; modalViewControllerDelegate </code></pre> <p>in both parentViewController and FirstModalViewController, right before calling presentModalViewController:... , set the following:</p> <pre><code> modalViewControllerAboutToAppear.modalViewControllerDelegate = self; [self presentModalViewController:modalViewControllerAboutToAppear animated:YES]; </code></pre> <p>next, in the SecondModalViewController, in the code where you determine that the item needs to be dismissed, call</p> <pre><code> [self.modalViewControllerDelegate modalViewControllerDidFinish]; </code></pre> <p>now, in FirstModalViewController, implement the following:</p> <pre><code> - (void)modalViewControllerDidFinish:(MyModalViewController*)controller { [self dismissModalViewControllerAnimated:YES] [self.modalViewControllerDelegate modalViewControllerDidFinish]; } </code></pre> <p>and finally, in the parent view controller, you should be able to perform:</p> <pre><code> - (void)modalViewControllerDidFinish:(MyModalViewController*)controller { [self dismissModalViewControllerAnimated:YES] } </code></pre>
    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.
    1. VO
      singulars
      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