File tree Expand file tree Collapse file tree 3 files changed +5
-13
lines changed
KtBaseModel/KtBaseListModel Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -44,23 +44,12 @@ - (void)didReceiveMemoryWarning {
4444 // Dispose of any resources that can be recreated.
4545}
4646
47- - (void )refreshRequestDidSuccess {
48- [super refreshRequestDidSuccess ];
47+ - (void )requestDidSuccess {
4948 for (KtMainTableBookItem *book in ((KtMainTableModel *)self.listModel ).tableViewItem .books ) {
5049 KtTableViewBaseItem *item = [[KtTableViewBaseItem alloc ] init ];
5150 item.itemTitle = book.bookTitle ;
5251 [self .dataSource appendItem: item];
5352 }
5453}
5554
56- - (void )loadRequestDidSuccess {
57- [super loadRequestDidSuccess ];
58- for (KtMainTableBookItem *book in ((KtMainTableModel *)self.listModel ).tableViewItem .books ) {
59- KtTableViewBaseItem *item = [[KtTableViewBaseItem alloc ] init ];
60- item.itemTitle = book.bookTitle ;
61- [self .dataSource appendItem: item];
62- }
63-
64- }
65-
6655@end
Original file line number Diff line number Diff line change 1313
1414@property (nonatomic , strong ) KtBaseListModel *listModel;
1515
16+ - (void )requestDidSuccess ; // 子类请求完成后的处理方法。
17+
1618@end
Original file line number Diff line number Diff line change @@ -20,11 +20,12 @@ - (void)viewDidLoad {
2020
2121#pragma -mark KtBaseListModelProtocol
2222- (void )loadRequestDidSuccess {
23-
23+ [ self requestDidSuccess ];
2424}
2525
2626- (void )refreshRequestDidSuccess {
2727 [self .dataSource clearAllItems ];
28+ [self requestDidSuccess ];
2829}
2930
3031- (void )handleAfterRequestFinish {
You can’t perform that action at this time.
0 commit comments