I have these delegate method for a tableview inside a class:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)ta
See how all the delegate methods have a tableView:(UITableView *)tableView
in them?
You can define your table views in the header file and then just simply go: (assuming your table is called myTable
)
if (tableView == myTable)
Then you can have as many table views as you like.
So for example:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [array1 count];
}
Becomes:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (tableView == myTable)
{
return [array1 count];
}
if (tableView == myTable2)
{
return [array2 count];
}
return 0;
}