Skip to content

Commit 40df1b1

Browse files
committed
添加列表选中效果
1 parent 1585fd6 commit 40df1b1

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

Coding_iOS/Controllers/AddReviewerViewController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa
151151
}
152152

153153
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
154+
[tableView deselectRowAtIndexPath:indexPath animated:YES];
154155
ReviewCell *currentCell = [tableView cellForRowAtIndexPath:indexPath];
155156
NSInteger index = indexPath.row;
156157
NSNumber* userState = self.selectUsers[index];

Coding_iOS/Controllers/MRDetailViewController.m

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,13 @@ - (void)refresh{
235235
NSMutableArray *resultA = weakSelf.curMRPRInfo.discussions;
236236
if(resultA != nil){
237237
[weakSelf.allDiscussions removeAllObjects];
238-
if(weakSelf.allDiscussions == nil || weakSelf.allDiscussions.count <= 0) {
239-
for (int i = 0; i<resultA.count; i ++) {
240-
NSArray *pArray = resultA[i];
241-
ProjectLineNote* addTmp = pArray[0];
242-
if (addTmp.path != nil) {
243-
addTmp.action = @"mergeChanges";
244-
}
245-
[weakSelf.allDiscussions addObject:addTmp];
238+
for (int i = 0; i<resultA.count; i ++) {
239+
NSArray *pArray = resultA[i];
240+
ProjectLineNote* addTmp = pArray[0];
241+
if (addTmp.path != nil) {
242+
addTmp.action = @"mergeChanges";
246243
}
244+
[weakSelf.allDiscussions addObject:addTmp];
247245
}
248246
}
249247
weakSelf.bottomView = nil;
@@ -281,16 +279,12 @@ - (void)refresh{
281279
}];
282280
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:self.activityPath withParams:@{@"iid": _curMRPR.iid} withMethodType:Get andBlock:^(id data, NSError *error) {
283281
if (data) {
284-
weakSelf.loadedActivty = true;
285282
id resultData = [data valueForKeyPath:@"data"];
286283
NSMutableArray *resultA = [NSObject arrayFromJSON:resultData ofObjects:@"ProjectLineNote"];
287284
if(resultA != nil){
288-
[weakSelf.activityCList removeAllObjects];
289-
if(weakSelf.activityCList == nil || weakSelf.activityCList.count <= 0) {
290-
for (int i = 0; i<resultA.count; i ++) {
291-
ProjectLineNote* addTmp = resultA[i];
292-
[weakSelf.activityCList addObject:addTmp];
293-
}
285+
for (int i = 0; i<resultA.count; i ++) {
286+
ProjectLineNote* addTmp = resultA[i];
287+
[weakSelf.activityCList addObject:addTmp];
294288
}
295289
[weakSelf sortActivityList];
296290
}

0 commit comments

Comments
 (0)