1、首先,在成为某个视图的子视图时,先移除之前的kVO,然后对视图层级中所有class为UIScrollView的contentSize添加KVO。

3、然后,需要设置TableViewseparatorStyle属性UITableViewCellSeparatorStyleNone即除划。代码:tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

5、然后,打印监测到的值变化:static NSMutableArray *receiverArr; stat足毂忍珩ic SunTableViewCell *cell; - (void)observer:(NSObject *)receiver forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context { if (cell && cell != self) { return; } cell = self; [receiver addObserver:self forKeyPath:keyPath options:options context:context]; if (!receiverArr) { receiverArr = [NSMutableArray array]; } [receiverArr addObject:receiver]; } - (void)dealloc { [self unKVO];
