Note that there are some explanatory texts on larger screens.

plurals
  1. POHow does one access a super's view controller?
    primarykey
    data
    text
    <p>I have a problem and I will try to explain the issue:</p> <ol> <li>I have one main <code>UIViewController</code> (Whole screen)</li> <li>I have one secondary <code>UIViewController</code> (setbounds)</li> <li><p>I added my secondary view to my <code>mainView</code> using this:</p> <pre><code>[mainController.view addSubview:secondaryController.view]; </code></pre></li> <li><p>I created a third controller: <code>modalController</code>, I added it to my secondary controller like this:</p> <pre><code>[secondaryController presentModalViewController:modalController animated:YES]; </code></pre></li> <li><p>I make calculus based on some events inside of my <code>modelController</code>.</p></li> <li><p>I am able to send messages from my <code>modalController</code> to my <code>secondaryController</code> using:</p> <pre><code>[[self parentViewController] performSelector : @selector(myMethodInSecondaryController:) withObject : myObject afterDelay : .5]; </code></pre> <p><strong>NOTE:</strong> "self" corresponds to the <code>modalController</code></p></li> <li><p>I need to pass "myObject" to my <code>mainController</code>, but i cant make reference to my <code>mainController</code> from the <code>secondaryController</code>. I tried this:</p> <pre><code>[[self parentViewController] performSelector : @selector(myMethodInMainController:) withObject:myObject afterDelay : .5]; </code></pre> <p><strong>NOTE:</strong> "self" corresponds to the <code>secondaryController</code></p> <p>but it doesn't work, i have access to my mainController's view using : <code>self.view.superview</code></p> <p><strong>NOTE:</strong> "self" is my <code>secondaryController</code></p></li> </ol> <p>but no to its controller. </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