I am developing iOS App with Multiple TableViews on Single View controller. The Value show on each tableview from a single array. But the problem is that the array value is displayed on first table view but not on the other. Some time second tableview cell value show First tableview. I also tried to do with tableview tag value.
code..
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [_arrayResult 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];
}
if ( tableView == _tableView) { //_clentSelect.tag == 2
MEObject *obj = [_arrayResult objectAtIndex:indexPath.row];
UILabel *dropValue = (UILabel *)[cell viewWithTag:100];
dropValue.text = obj.emp_client_name;
}
if (tableView == _eventSeclect) { //_clentSelect.tag == 2
MEObject *obj = [_arrayResult objectAtIndex:indexPath.row];
UILabel *dropValue = (UILabel *)[cell viewWithTag:1000];
dropValue.text = obj.emp_event_name;
NSLog(@"%@",dropValue.text);
}
// if(_clentSelect.tag == 3) {
//
// MEObject *obj = [_arrayResult objectAtIndex:indexPath.row];
// cell.textLabel.text = obj.emp_client_name;
// }
return cell;
}
if tableView == tableOne