title: Unable to insert cells in UITableView with data coming from API
body: <p>I have a situation where I have to insert cells in my <code>UITableView</code>.
  I implemented these three delegate fuctions and it is working well when the data is defined in <code>viewDidLoad</code>.</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
      categoryData = [NSMutableArray arrayWithObjects:@"Egg Benedict", @"Mushroom Risotto", @"Full Breakfast", @"Hamburger", @"Ham and Egg Sandwich", @"Creme Brelee", @"White Chocolate Donut", @"Starbucks Coffee",@"Ham and Cheese Panini", nil];
      _categoryMenuTable.dataSource = self;
      _categoryMenuTable.delegate = self;
  }
  
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
      return 1;
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
      return [categoryData count];
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
      static NSString *CellIdentifier = @"Cell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
      }
      cell.textLabel.text = [NSString stringWithFormat:[categoryData objectAtIndex:indexPath.row]];
      return cell;
  }
  </code></pre>
  
  <p>But in my case <code>categoryData</code> comes from an API asynchronously, that obviously loads after <code>viewDidLoad</code>.</p>
  
  <p>So the real problem is, in the later case, I am unable to call the delegate methods.</p>
  
  <p>PS I also tried</p>
  
  <pre><code>[_categoryMenuTable reloadData];
  </code></pre>
  
  <p>after setting data to <code>categoryData</code> like</p>
  
  <pre><code>-(void)setCategories:(NSMutableArray*)arr    {
      categoryData = arr;
      _categoryMenuTable.dataSource = self;
      _categoryMenuTable.delegate = self;
      [_categoryMenuTable reloadData];
  }
  </code></pre>
  
  <p>I more thing i want to mention is I am using MMDawerController
  <a href="https://github.com/mutualmobile/MMDrawerController" rel="nofollow">https://github.com/mutualmobile/MMDrawerController</a></p>
  
  <p>How can I get the data from the API into my table?</p>