Skip to content

Commit 0694ede

Browse files
committed
系统通知界面,时间有些显示不全
快捷创建任务选择项目,项目列表把常用项目排在前面
1 parent 8da990f commit 0694ede

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

Coding_iOS/Views/Cell/CodingTipCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
3939
[self.contentView addSubview:_contentLabel];
4040
}
4141
if (!_timeLabel) {
42-
_timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 80, 0, 80, 15)];
42+
_timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 100, 0, 100, 15)];
4343
_timeLabel.font = [UIFont systemFontOfSize:12];
4444
_timeLabel.backgroundColor = [UIColor clearColor];
4545
_timeLabel.textColor = [UIColor colorWithHexString:@"0x999999"];

Coding_iOS/Views/TableListView/ProjectListView.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ - (void)setupDataList{
112112
kValueKey : noPinList}];
113113
}
114114
}else{
115-
NSArray *list = [self updateFilteredContentForSearchString:self.mySearchBar.text];
115+
NSMutableArray *list = [self updateFilteredContentForSearchString:self.mySearchBar.text];
116116
if (list.count > 0) {
117+
[list sortUsingComparator:^NSComparisonResult(Project *obj1, Project *obj2) {
118+
return (obj1.pin.integerValue < obj2.pin.integerValue);
119+
}];
117120
[_dataList addObject:@{kTitleKey : @"一般项目",
118121
kValueKey : list}];
119122
}
@@ -278,7 +281,7 @@ - (void)searchProjectWithStr:(NSString *)string{
278281
[self.myTableView reloadData];
279282
}
280283

281-
- (NSArray *)updateFilteredContentForSearchString:(NSString *)searchString{
284+
- (NSMutableArray *)updateFilteredContentForSearchString:(NSString *)searchString{
282285
// start out with the entire list
283286
NSMutableArray *searchResults = [self.myProjects.list mutableCopy];
284287

@@ -329,7 +332,7 @@ - (NSArray *)updateFilteredContentForSearchString:(NSString *)searchString{
329332

330333
NSCompoundPredicate *finalCompoundPredicate = (NSCompoundPredicate *)[NSCompoundPredicate andPredicateWithSubpredicates:andMatchPredicates];
331334

332-
searchResults = [[searchResults filteredArrayUsingPredicate:finalCompoundPredicate] copy];
335+
[searchResults filterUsingPredicate:finalCompoundPredicate];
333336
return searchResults;
334337
}
335338

0 commit comments

Comments
 (0)