@@ -28,6 +28,7 @@ @interface CSTopiclistView()<SWTableViewCellDelegate>
2828
2929// 根据不同的type,走不同而数据更新逻辑,外界不传值进来
3030@property (nonatomic ,assign )CSMyTopicsType type;
31+ @property (nonatomic , strong ) NSString *globalKey;
3132
3233@property (nonatomic ,assign )BOOL isLodding;
3334@property (nonatomic , assign ) BOOL hasMore;
@@ -37,11 +38,12 @@ @interface CSTopiclistView()<SWTableViewCellDelegate>
3738
3839@implementation CSTopiclistView
3940
40- - (id )initWithFrame : (CGRect)frame type : (CSMyTopicsType )type block : (TopicListViewBlock)block {
41+ - (id )initWithFrame : (CGRect)frame globalKey : ( NSString *) key type : (CSMyTopicsType )type block : (TopicListViewBlock)block {
4142 self = [super initWithFrame: frame];
4243 if (self) {
4344 // Initialization code
4445 _dataList = [[NSMutableArray alloc ] init ];
46+ _globalKey = [key copy ];
4547 _type = type;
4648 _block = block;
4749 _myTableView = ({
@@ -138,12 +140,12 @@ - (void)sendRequest{
138140 __weak typeof (self) weakSelf = self;
139141
140142 if (_type == CSMyTopicsTypeWatched) {
141- [[Coding_NetAPIManager sharedManager ] request_WatchedTopicsWithUserGK: [Login curLoginUser ].global_key page: self .curPage block: ^(id data, BOOL hasMoreData, NSError *error) {
143+ [[Coding_NetAPIManager sharedManager ] request_WatchedTopicsWithUserGK: weakSelf.globalKey page: weakSelf .curPage block: ^(id data, BOOL hasMoreData, NSError *error) {
142144 weakSelf.hasMore = hasMoreData;
143145 [weakSelf doAfterGotResultWithData: data error: error];
144146 }];
145147 }else {
146- [[Coding_NetAPIManager sharedManager ] request_JoinedTopicsWithUserGK: [Login curLoginUser ].global_key page: self .curPage block: ^(id data, BOOL hasMoreData, NSError *error) {
148+ [[Coding_NetAPIManager sharedManager ] request_JoinedTopicsWithUserGK: weakSelf.globalKey page: weakSelf .curPage block: ^(id data, BOOL hasMoreData, NSError *error) {
147149 weakSelf.hasMore = hasMoreData;
148150 [weakSelf doAfterGotResultWithData: data error: error];
149151 }];
0 commit comments