You should avoid manipulating the cell with every load, instead you should configure the user interface when the cell is initialized / created.
, , ( ), cellForRowAtIndexPath:, , , (, , ). , , . .
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *identifier1 = @"identifer-1";
static NSString *identifier2 = @"identifier-2";
static NSString *regular = @"regular";
UITableViewCell *cell;
if (comment.isReply == NO) {
cell = [tableView dequeueReusableCellWithIdentifier: identifier1];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: identifier1] autorelease];
}
} else if (comment.isReply == YES) {
cell = [tableView dequeueReusableCellWithIdentifier: identifier2];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: identifier2] autorelease];
}
} else {
cell = [tableView dequeueReusableCellWithIdentifier: regular];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: regular] autorelease];
}
}
return cell;
}
, , , , UITableView .