https://github.com/singro/SCPullRefresh
self.tableHeaderView = [[UIView alloc] initWithFrame:(CGRect){0, 0, kScreenWidth, 0}];
关于viewDidLoad 和 loadView
http://stackoverflow.com/questions/573958/iphone-sdk-what-is-the-difference-between-loadview-and-viewdidload
导航+UITableView,在push,back回来之后,当前cell仍然是选中的状态。
当然,解决办法简单,添加一句[tableView deselectRowAtIndexPath:indexPath animated:YES]即可。
令人纠结的时,在没加这句的时候,有的视图同样回来之后,选中状态消失,为什么会出现这种情况呢?
原来是,如果UITableView是在UITableViewController中时,就会默认取消,而如果是在UIViewController时,需要添加这一句,不过有时即使前者也需要添加,那是因为在视图加载时有其它功能代码,具体情况各异。所以后者必须加,前者可能需要加。
- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:YES]; }
为什么要delegate = nil
http://stackoverflow.com/questions/15016348/set-delegates-to-nil-under-arc
- (void)dealloc { self.tableView.delegate = nil; self.tableView.dataSource = nil; [[NSNotificationCenter defaultCenter] removeObserver:self]; }
- (void)viewWillLayoutSubviews { [super viewWillLayoutSubviews]; self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(self.tableViewInsertTop, 0, self.tableViewInsertBottom, 0); NSLog(@"%s",__func__); }
2015-08-26 12:20:32.298 SCPullRefresh[79798:1946898] -[SCPullRefreshViewController viewWillLayoutSubviews] 2015-08-26 12:20:32.306 SCPullRefresh[79798:1946898] -[SCPullRefreshViewController viewWillLayoutSubviews]
调用了两次。
指定滚动条在scrollerView中的位置
http://www.cnblogs.com/woainilsr/archive/2012/03/28/2421881.html
self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(self.tableViewInsertTop, 0, self.tableViewInsertBottom, 0);
UIEdgeInsetsMake 逆时钟,上左下右
@property (nonatomic, copy) void (^loadMoreBlock)();