This problem arises because Your UITableView Reuse Cell instantly creates a new one. I am giving you some suggestion that may help you.
1) add a UIView between
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) {
1) Add your UIView to cell.contentView.
Edition:
Before following my Edited answer, I want to tell you that the following code is bad for memory management, because it will create a new cell for each row of the UITableView , so be careful.
But it is better if the UITableView has a limited string (50-100 maybe) use the following code if it suits you.
NSString *CellIdentifier = [NSString stringWithFormat:@"S%1dR%1d",indexPath.section,indexPath.row]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell == nil) { }
source share