File tree Expand file tree Collapse file tree 3 files changed +1
-7
lines changed
Expand file tree Collapse file tree 3 files changed +1
-7
lines changed Original file line number Diff line number Diff line change 2424@interface TipsViewController ()
2525@property (nonatomic , strong ) UITableView *myTableView;
2626@property (nonatomic , strong ) ODRefreshControl *refreshControl;
27- @property (strong , nonatomic ) NSNumber *unreadCount;
2827@end
2928
3029@implementation TipsViewController
@@ -58,15 +57,12 @@ - (void)loadView{
5857 switch (self.myCodingTips .type ) {
5958 case 0 :
6059 titleStr = @" @我的" ;
61- self.unreadCount = [_notificationDict objectForKey: kUnReadKey_notification_AT ];
6260 break ;
6361 case 1 :
6462 titleStr = @" 评论" ;
65- self.unreadCount = [_notificationDict objectForKey: kUnReadKey_notification_Comment ];
6663 break ;
6764 case 2 :
6865 titleStr = @" 系统通知" ;
69- self.unreadCount = [_notificationDict objectForKey: kUnReadKey_notification_System ];
7066 break ;
7167 default :
7268 break ;
@@ -156,7 +152,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
156152 CodingTipCell *cell = [tableView dequeueReusableCellWithIdentifier: kCellIdentifier_CodingTip forIndexPath: indexPath];
157153 CodingTip *tip = [_myCodingTips.list objectAtIndex: indexPath.row];
158154 cell.curTip = tip;
159- cell.hasBeenRead = indexPath.row >= self.unreadCount .integerValue ;
160155 __weak typeof (self) weakSelf = self;
161156 cell.linkClickedBlock = ^(HtmlMediaItem *item, CodingTip *tip){
162157 [weakSelf analyseHtmlMediaItem: item andTip: tip];
Original file line number Diff line number Diff line change 1212@interface CodingTipCell : UITableViewCell <TTTAttributedLabelDelegate>
1313@property (strong , nonatomic ) UITTTAttributedLabel *contentLabel;
1414@property (strong , nonatomic ) CodingTip *curTip;
15- @property (assign , nonatomic ) BOOL hasBeenRead;
1615@property (copy , nonatomic ) void (^linkClickedBlock)(HtmlMediaItem *item, CodingTip *tip);
1716+ (CGFloat)cellHeightWithObj : (id )obj ;
1817
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ - (void)layoutSubviews{
5454 if (!_curTip) {
5555 return ;
5656 }
57- _contentLabel.textColor = [UIColor colorWithHexString: _hasBeenRead ? @" 0x999999" :@" 0x222222" ];
57+ _contentLabel.textColor = [UIColor colorWithHexString: _curTip.status.boolValue ? @" 0x999999" :@" 0x222222" ];
5858
5959 CGFloat curBottomY = 10 ;
6060 _iconView.image = [UIImage imageNamed: [NSString stringWithFormat: @" tipIcon_%@ " , _curTip.target_type]];
You can’t perform that action at this time.
0 commit comments