SwiftKickMobile / TLIndexPathTools

TLIndexPathTools is a small set of classes that can greatly simplify your table and collection views.
tlindexpathtools.com
MIT License
347 stars 60 forks source link

Issues with another table view within same controller #43

Closed stan94 closed 9 years ago

stan94 commented 9 years ago

Hi Tim,

Everything works fine until I added another table view (a normal table view with cells). I wrote the NumberOfRowsInSection and it somehow conflicting with your table view.

Here are my code -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (tableView == self.mainTableView) { return [self.fightcardArray count]; } else { return 0; } } mainTableView is the new table view that I added. What should I put in the Else block so that it can differentiate and return the correct value?

wtmoose commented 9 years ago
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (tableView == self.mainTableView)
    {
        return [self.fightcardArray count];
    }
    else
    {
        return [super tableView:tableView numberOfRowsInSection:section];
    }
}