Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>that's a very general question. you're basically asking how to pass information from one controller to another controller. There are different ways to do that, a protocol (what a delegate generally communicates through) is one of them. The quickest thing you can do w/o making assumptions in your code that may be problematic later would be to pass the homeScreenController along as you push <code>messageListController</code> and then <code>detailMessageController</code>. You'll need to define an iVar and property in <code>messageListController</code> and <code>detailMessageController</code> to do this.</p> <p>Something like:</p> <p>in <code>messageListController.h</code>:</p> <pre><code>#import "HomeScreenController.h" @interface messageListController : UITableViewController { // your iVars HomeScreenController *homeScreenController; @end @property (nonatomic, assign) HomeScreenController * homeScreenController; </code></pre> <p>add the same iVar and property for <code>homeScreenController</code> to <code>detailMessageController</code>.</p> <p>in <code>homeScreenController.h</code>:</p> <pre><code>- (void)pushMessageListController { MessageListController *messageListController = [[MessageListController alloc] init]; messageListController.homeScreenController = self; // push messageListController onto navigation controller here [messageListController release]; } </code></pre> <p>in <code>messageListController</code> do the same thing as above when creating and pushing <code>detailMessageController</code>. Now, in <code>detailMessageController</code> you can send messages directly to <code>homeScreenController</code>.</p> <p>If you want to generalize the above implementation so your controllers aren't specifically knowledgeable about each other then you can define a protocol and pass <code>homeScreenController</code> through as a delegate supporting that protocol.</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