Skip to content

Commit e8fe6ce

Browse files
committed
准备工作
1 parent 61ba974 commit e8fe6ce

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

KtTableView/KtTableView/KtBaseModel/KtBaseItem.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
// 所有需要映射的property都需要设定此规则
1818
- (void)addMappingRuleProperty:(NSString*)propertyName pathInJson:(NSString*)path;
1919

20+
- (id)setData:(id)data;
21+
2022
@end
2123

2224
@interface KtClassHelper : NSObject

KtTableView/KtTableView/KtTableViewDataSource.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
@property (nonatomic, strong) NSMutableArray *sections; // 二维数组,每个元素都是一个 SectionObject
2626

27+
- (void)clearAllItems;
2728
- (void)appendItem:(KtTableViewBaseItem *)item;
2829

2930
@end

KtTableView/KtTableView/KtTableViewDataSource.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ - (Class)tableView:(UITableView*)tableView cellClassForObject:(KtTableViewBaseIt
3030
return [KtBaseTableViewCell class];
3131
}
3232

33+
- (void)clearAllItems {
34+
self.sections = [NSMutableArray arrayWithObject:[[KtTableViewSectionObject alloc] init]];
35+
}
36+
3337
- (void)appendItem:(KtTableViewBaseItem *)item {
3438
KtTableViewSectionObject *firstSectionObject = [self.sections objectAtIndex:0];
3539
[firstSectionObject.items addObject:item];

0 commit comments

Comments
 (0)