Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

when I set UITableViewCellSeparatorStyleNone to a tableView, still the separatorview is visble?

I set the property of tableview,

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

and in view debug I still found a UITableViewCellSeparatorView in my cell, How do I remove the separator view?

since cells are being reused when presented (with dequeueReusableCellWithIdentifier ): you have to use a different identifier for that cell.. I made a custom UITableViewCell subclass for it too.

this is a code where my last cell is a special cell that will load X more cells..

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == lastIndex) {
        LoadingNextCellView *cell = [tableView dequeueReusableCellWithIdentifier:@"LoadingNextCell"];
        if (cell == nil) {
            cell = [[LoadingNextCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"LoadingNextCell"];
        cell.indexPath = indexPath;
        cell.titleLabel.text = [NSString stringWithFormat:@"Loading next %d trees..",PRELOAD_TREES];
        return cell;
    } else {
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
     return cell; 

Customie your cell according to this logic.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.