title: connect button to TableViewController in xcode
body: <p>I have a button in my view controller and I want to connect my button to table view controller (It means that when I click on button it loads and brings my table)</p>
  
  <p>but I don't know how should I do that(I can connect my button to another view controller but not to the table ), here is my code </p>
  
  <p>Thanks in advance!(I'm really beginner)</p>
  
  <p>FirstViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface FirstViewController : UIViewController
  
  @end
  </code></pre>
  
  <p>FirstViewController.m</p>
  
  <pre><code>#import "FirstViewController.h"
  
  @interface FirstViewController ()
  
  @end
  
  @implementation FirstViewController
  
  - (void)viewDidLoad
  {
  [super viewDidLoad];
  // Do any additional setup after loading the view, typically from a nib.
  }
  
  - (void)viewDidUnload
  {
  [super viewDidUnload];
  // Release any retained subviews of the main view.
  }
  
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
  if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
      return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
  } else {
      return YES;
  }
  }
  
  @end
  </code></pre>
  
  <p>CreateViewController.h //my table</p>
  
  <pre><code> #import &lt;UIKit/UIKit.h&gt;
  
   @interface CreateViewController : UIViewController &lt;
   UITableViewDataSource, UITableViewDelegate&gt;
   {
   NSArray *tableData;
  
   }
  
   @property (nonatomic, retain) NSArray *tableData;
   @end
  </code></pre>
  
  <p>CreateViewController.m</p>
  
  <pre><code>#import "CreateViewController.h"
  
  @implementation CreateViewController
  @synthesize tableData;
  
  
  #pragma mark - View lifecycle
  
  - (void)viewDidLoad
  {
  tableData = [[NSArray alloc] initWithObjects:@"Johan", @"Paul",@"George",@"Ringo", nil];
  [super viewDidLoad];
  // Do any additional setup after loading the view.
  }
  
  #pragma mark - TableView Data Source methods
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
  return [tableData count];
  
  }
  
  
   - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
  UITableViewCell *cell = nil;
  
  cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell"];
  if(cell == nil)
  {
      cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyCell"];
  
  }
  cell.textLabel.text = [tableData objectAtIndex:indexPath.row];
  
  return cell;
  }
  
  
   @end
  </code></pre>
  
  <p>Edit: I used story board</p>