0
#import "UITableViewCell+Line.h"

@implementation UITableViewCell (Line)

- (void)layoutSubviews{

    [super layoutSubviews];

    for (UIView *subview in self.contentView.superview.subviews) {

        if ([NSStringFromClass(subview.class) hasSuffix:@"SeparatorView"]) {

            subview.hidden = NO;
        }
    }
}

when I use this method,UITableView will not load data. Every cell does not appear data,the dataArray is not nil,it also has data. why? because layoutSubviews ?

iAnurag
  • 9,286
  • 3
  • 31
  • 48
  • If you are just trying to show separators on your cells, this is the wrong way to go about it. Have a look at separator styles in the docs https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableViewCell_Class/ – GCBenson Jun 14 '16 at 09:49
  • This is not the way of reloading cells. What exactly you trying to achieve ?? – Alok Rao Jun 14 '16 at 10:01
  • i have showed separators ,but between the last cell and footview,the separators is not appear,so i user the method: layoutSubviews .then all cells have separator,but cell 's content is disappear,there is nothing in cell,no data. – 火焰与柠檬 Jun 14 '16 at 10:40

0 Answers0