title: Where and how to set protocol delegate when slide out menu implemented in navigation controller?
body: <p>Imagine you have the following storyboard scheme:</p>
  
  <p><a href="http://i.stack.imgur.com/0YDEV.png" rel="nofollow">Slide out menu UITableView and feed UITableView embedded in Nav controllers</a></p>
  
  <p>You want to filter out your feed based on the content of the cell that is tapped in the slide out menu.  </p>
  
  <p>As you can see on the storyboard scheme I shared above, you want to do this dynamically using only one segue whose identifier is:</p>
  
  <pre><code>@"Filter_MenuItem"
  </code></pre>
  
  <p>You declared the following protocol in the slide out menu view controller:</p>
  
  <pre><code>//  SlideOutMenuTableViewController.h
  
  #import &lt;UIKit/UIKit.h&gt;
  #import "SlideOutMenuItems.h"
  #import "SlideOutMenuCellTableViewCell.h"
  
  @protocol filterFeed &lt;NSObject&gt;
  
  -(void)filterFeedFromSlideOutItemTapped:(NSString *)slideOutItemStringData; //String to pass slideOut menu item string back to feed
  @end
  
  
  @interface SlideOutMenuTableViewController : UITableViewController
  
  @property(nonatomic,assign)id&lt;filterFeed&gt; stringDelegate;
  
  @end
  </code></pre>
  
  <p>And you implement the protocol method <code>filterFeedFromSlideOutItemTapped:</code>in your feed view controller:</p>
  
  <pre><code>#pragma mark - Filter feed based on slideout menu item tapped
  
  -(void)filterFeedFromSlideOutItemTapped:(NSString *)slideOutItemStringData
  {
      NSLog(@"filterFeedFromSlideOutItemTapped just started");
      if (!(slideOutItemStringData == (nil)))
          {//Pass self.feed.flames + filtering string ==&gt; filtered flames
              NSMutableArray* allFlames = [[NSMutableArray alloc] initWithArray:self.feed.flames];
              NSString *flameRelationFilter = slideOutItemStringData;
              NSPredicate* sortFlames = [NSPredicate predicateWithFormat:@"(kFlameRelation like %@)", flameRelationFilter];
              NSArray* filteredFlames = [allFlames filteredArrayUsingPredicate:sortFlames];
              NSLog(@"The filter flames are %@", filteredFlames);
              NSMutableArray *mutableFilteredFlames = [filteredFlames mutableCopy];
              self.filteredFeed.flames = mutableFilteredFlames;
  
              [self.tableView reloadData];
  
          }
  }
  </code></pre>
  
  <p>You make sure to synthesize your delegate in the implementation of your slide out menu view controller: <code>@synthesize stringDelegate;</code></p>
  
  <p>And before you call your protocol method in the implementation of your slide out menu view controller:</p>
  
  <pre><code>[stringDelegate filterFeedFromSlideOutItemTapped:[self.slideOutMenuItems menuItemAtIndex:indexPath.row]];
  </code></pre>
  
  <p>you know that, first, you need to initialize your protocol delegate:</p>
  
  <pre><code>instanceOfSlideOutMenuTableViewController.stringDelegate=self;
  </code></pre>
  
  <p>Generally, you do that successfully in a "prepareForSegue" method.  But this time it's more complicated since you implemented a slide out menu (you actually didn't reinvent the wheel, you picked your implementation <a href="https://github.com/John-Lluch/SWRevealViewController" rel="nofollow" title="slide out menu implementation">here</a>).</p>
  
  <p>Where and how should you initialize your protocol delegate?</p>