title: iOS - Third TableView in ViewController not loading nib
body: <p>I'm trying to populate 3 different <code>TableViews</code> inside of my <code>ViewController</code> (different tableviews appear based on the <code>UISegmentControl</code> selected) - <code>sidetableView</code>, <code>neighboursView</code>, and <code>friendsView</code>. The first two populate perfectly, however the third one (<code>neighboursView</code>) doesn't seem to load the cell. See code below. Any idea as to why? I feel like I'm defining the third nib in <code>viewdidLoad</code> wrong? </p>
  
  <p><strong>ViewController.h</strong></p>
  
  <pre><code>- (IBAction)segmentControl:(id)sender;
  @property (weak, nonatomic) IBOutlet UISegmentedControl *segmentControl;
  @property (weak, nonatomic) IBOutlet UITableView *sidetableView;
  @property (strong, nonatomic) NSMutableArray *myFriendData;
  @property (weak, nonatomic) IBOutlet UITableView *neighboursView;
  @property (strong, nonatomic) NSMutableArray *friendData;
  @property (strong, retain) NSMutableArray *neighbourData;
  
  @property (strong, nonatomic) IBOutlet UITableView *friendsView;
  </code></pre>
  
  <p><strong>ViewController.m</strong></p>
  
  <pre><code>- (void)viewDidLoad {
          [super viewDidLoad];
           UINib *nib = [UINib nibWithNibName:@"sidebarCell" bundle:nil];
          [self.friendsView registerNib:nib forCellReuseIdentifier: @"sidebarCell"];
          nib = [UINib nibWithNibName:@"MyFriendTableViewCell" bundle:nil];
          [self.sidetableView registerNib:nib forCellReuseIdentifier: @"MyFriendTableViewCell"];
          nib = [UINib nibWithNibName:@"sidebarCell" bundle:nil];
          [self.neighboursView registerNib:nib forCellReuseIdentifier: @"sidebarCell"];
   }
  
  - (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      if (tableView == self.sidetableView) {
          if ([self.myFriendData count] &gt; 0) {
              return [self.myFriendData count];
          } else {
               return 0;
          }
      }
      if (tableView == self.friendsView) {
          if ([self.friendData count] &gt; 0) {
              return [self.friendData count];
  
          } else {
              return 0;
            } 
      }
       else {
  
        //  return [self.neighbourData count];
  
      }
      return 0;
  
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
         if (tableView == self.sidetableView) {
                self.sidetableView.separatorStyle = UITableViewCellSeparatorStyleNone;
               MyFriendTableViewCell *cell = (MyFriendTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"MyFriendTableViewCell"];
               NSDictionary *friendsName = [self.myFriendData objectAtIndex:indexPath.row];
              [[cell friendName] setText:[friendsName objectForKey:@"title"]];
              NSDictionary *friendsBio = [self.myFriendData objectAtIndex:indexPath.row];
              [[cell friendBio] setText:[friendsBio objectForKey:@"field_friendbio"][@"und"][0][@"safe_value"]];
              NSString *profilePath = [[self.myFriendData objectAtIndex:indexPath.row] objectForKey:@"field_picture"][@"und"][0][@"safe_value"];
             [cell.friendPic sd_setImageWithURL:[NSURL URLWithString:profilePath]];
             NSLog(@"This is profilePath %@",profilePath);
             return cell;
       }
       if (tableView == self.friendsView)
       {
              self.friendsView.separatorStyle = UITableViewCellSeparatorStyleNone;
              sidebarCell *cell = (sidebarCell *)[tableView dequeueReusableCellWithIdentifier:@"sidebarCell"];
              NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"sidebarCell" owner:self options:nil];
             cell = [nib objectAtIndex:0];
             NSDictionary *userName = [self.friendData objectAtIndex:indexPath.row];
             [[cell username] setText:[userName objectForKey:@"node_title"]];
  
             NSDictionary *userBio = [self.friendData objectAtIndex:indexPath.row];
             [[cell userDescription] setText:[userBio objectForKey:@"body"]];
             NSString *profilePath = [[self.friendData objectAtIndex:indexPath.row] objectForKey:@"friendphoto"];
             [cell.usermini sd_setImageWithURL:[NSURL URLWithString:profilePath]];
             return cell;
  
         } else {
               sidebarCell *cell = (sidebarCell *)[tableView dequeueReusableCellWithIdentifier:@"sidebarCell"];
               NSDictionary *userName = [self.neighbourData objectAtIndex:indexPath.row];
               [[cell username] setText:[userName objectForKey:@"first name"]];
                NSDictionary *userlast = [self.neighbourData objectAtIndex:indexPath.row];
                [[cell lastName] setText:[userlast objectForKey:@"last name"]];
                NSDictionary *userBio = [self.neighbourData objectAtIndex:indexPath.row];
                [[cell userDescription] setText:[userBio objectForKey:@"userbio"]];
                NSString *profilePath = [[self.neighbourData objectAtIndex:indexPath.row] objectForKey:@"photo_path"];
                [cell.usermini sd_setImageWithURL:[NSURL URLWithString:profilePath]];
                NSLog(@"This is profilePath %@",profilePath);
        }
         /*UITableViewCell *cell;
         return cell;*/ Never put this line in your code otherwise your tableview cell its nil
    }
     - (IBAction)segmentControl:(id)sender {
  
          UISegmentedControl *segmentedControl = (UISegmentedControl *) sender;
          NSInteger selectedSegment = segmentedControl.selectedSegmentIndex;
  
          switch (selectedSegment)
          {
               case 0:
                     [self.sidetableView setHidden:NO];
                     [self.neighboursView setHidden:YES];
                     [self.friendsView setHidden:YES];
  
                      NSLog(@"Requests!");
                      break;
               case 1: //FRIENDS MAP VIEW
  
                    [self.sidetableView setHidden:YES];
                    [self.friendsView setHidden:NO];
                    [self.neighboursView setHidden:YES];
                    break;
               case 2:
  
                    [self.sidetableView setHidden:YES];
                    [self.neighboursView setHidden:NO];
                    [self.friendsView setHidden:YES];
                    break;
            }
     }
  </code></pre>