Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In <strong>MainViewController.m</strong>, implement the <code>flipSideViewControllerDelegate</code> method as:</p> <pre><code> - (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller { self.nameField.text=controller.changeText.text; } </code></pre> <p>So when the <code>done:</code> method is called, this delegate method is also called with your <code>flipSideViewController</code> object as the argument, through which <code>changeText</code> can be accessed.</p> <p>EDIT to answer question in comment:</p> <p>In your protocol FlipSideViewControllerDelegate, add this method:</p> <pre><code> - (void)flipsideViewControllerDidSelect:(NSIndexPath*)indexPath </code></pre> <p>Then it is similar to the other delegate method implementation in <strong>MainViewController.m</strong> , which is how the protocol works really. If your MainViewController conforms to the protocol, it can implement methods of that protocol. By default all the methods declared in the protocol are optional, but you have the option to specify if the method is optional or required by using</p> <pre><code>@optional //list of methods @required //list of methods </code></pre> <p>Bear in mind that if your a method is declared as required in the protocol, any class conforming to that protocol <strong>must</strong> implement it. Anyway, in your <strong>MainViewController.m</strong>:</p> <pre><code>- (void)flipsideViewControllerDidSelect:(NSIndexPath*)indexPath { int anInt=indexPath.row; self.nameField.text=[NSString stringWithFormat:@"%d",anInt]; } </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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