I am new in iOS application Development and i need help on UItableview. As i am populating the table-view with json data.I am also Using Customized Tableviewcell also. I am not getting the "huid" value of selected cell on "lbluid". The "lbluid" is showing value of "huid" according to scroll as i will scroll up it will show the "huid" value of upper most visible cell of the UITableview and if i scroll down it will show the "huid" value of last visible cell from down.
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"SimpleTableCell";
SimpleTableCell *cell = (SimpleTableCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell" owner:self options:nil];
cell = [nib objectAtIndex:0];;
}
NSUInteger row = [indexPath row];
cell.lbl4.text = [hudid objectAtIndex:row];
lbluid.text=cell.lbl4.text;
return cell;
}
Simpletablecell
is the customized UITableViewCell
.