title: Ios Launching Fgallery from UITableView in tabbed application
body: <p>I am trying to build a small app. It's a tabbed app with 3 tabs: photos, videos, documents
  Each tab displays a tableview to select wich gallery, video, document is to be shown; Videos work fine.</p>
  
  <p>I'm having trouble with photo galleries. I use <strong>Fgallery</strong> which is working fine from the sample: <a href="https://github.com/gdavis/FGallery-iPhone/tree/master/FGallery" rel="nofollow">Fgallery git</a></p>
  
  <h2>.h</h2>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import "FGalleryViewController.h"
  
  @interface FirstViewController : UIViewController &lt;FGalleryViewControllerDelegate, UITableViewDelegate, UITableViewDataSource&gt; { 
      NSArray *localCaptions;
      NSArray *localImages;
      NSArray *networkCaptions;
      NSArray *networkImages;
      FGalleryViewController *localGallery;
      FGalleryViewController *networkGallery;
  }
  
  @property (nonatomic, strong) UITableView *myTableView;
  @end
  </code></pre>
  
  <h2>.m</h2>
  
  <pre><code>#import "FirstViewController.h"
  
  @implementation FirstViewController
  @synthesize myTableView;
  
  #pragma mark - View lifecycle
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      CGRect tableViewRect = self.view.bounds;
      UITableView *tableView = [[UITableView alloc]
                                initWithFrame:tableViewRect
                                style:UITableViewStylePlain];
      self.myTableView = tableView;   
      self.myTableView.autoresizingMask =
      UIViewAutoresizingFlexibleHeight |
      UIViewAutoresizingFlexibleWidth;
  
      [self.view addSubview:self.myTableView];
      self.myTableView.dataSource = self;
      self.myTableView.delegate = self;
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>#pragma mark - Table view delegate
  
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
  {
               NSLog( @"Choix Table");
  
      if( indexPath.row == 0 ) {
          NSLog( @"selection 1");
  
          localGallery = [[FGalleryViewController alloc] initWithPhotoSource:self];
          [self.navigationController pushViewController:localGallery animated:YES];  
      }
      else if( indexPath.row == 1 ) {
          networkGallery = [[FGalleryViewController alloc] initWithPhotoSource:self];
          [self.navigationController pushViewController:networkGallery animated:YES];
      ...
  }
  </code></pre>
  
  <p>I really don't know how to display the gallery. The <code>didSelectRowAtIndexPath</code> is the one from <strong>fgallery</strong>, I tried to modify it to show the viewm but I'm new to Objective-C and I'm stuck.</p>
  
  <p>Any help or guideline will be appreciated.</p>
  
  <p>Thanks</p>