Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>in your <code>Scene2ViewController</code> header, you can put a <code>@property</code> of your current view controller so you have acces to its public variables</p> <p>so in <code>Scene2ViewController.h</code>:</p> <pre><code>#import "YourPreviousViewController.h" //add this to your @interface @property (strong) YourPreviousViewController *parent; </code></pre> <p>then in your current viewcontroller.m</p> <pre><code>-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { Scene2ViewController *destination = [segue destinationViewController]; destination.parent = self; } </code></pre> <p>then you can run your <code>returned</code> method from <code>Scene2ViewController</code> or you can just manipulate the public variables on your current viewcontroller ie <code>parent</code></p> <p>edit: i have never seen a returned method like that before, you could just make a method that will set the variables you need in your current view controller, then in <code>Scene2ViewController</code> you can implement <code>- (void) viewWillDisappear { }</code> which will run when you press back or segue to another view</p> <pre><code>//Scene2ViewController.m - (void) viewWillDisappear { [self.parent returnAndSetBool:someBool]; //or if myBoolean in the previous view controller is a public variable you can just go: //self.parent.myBoolen = someBool; } </code></pre> <hr> <pre><code>//CurrentViewController.m - (void) returnAndSetBool: (bool) passbackVariable { self.myBoolean = passbackVariable; } </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