Skip to content

Commit 9d0d13a

Browse files
committed
私信页面小红点不一致的bug
1 parent 0b544c7 commit 9d0d13a

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

Coding_iOS/AppDelegate.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ - (void)applicationDidBecomeActive:(UIApplication *)application
146146
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
147147
if ([Login isLogin]) {
148148
[[UnReadManager shareManager] updateUnRead];
149+
UIViewController *presentingVC = [BaseViewController presentingVC];
150+
SEL selector = NSSelectorFromString(@"refresh");
151+
if ([presentingVC isKindOfClass:NSClassFromString(@"Message_RootViewController")]
152+
&& [presentingVC respondsToSelector:selector]) {
153+
#pragma clang diagnostic push
154+
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
155+
[presentingVC performSelector:selector];
156+
#pragma clang diagnostic pop
157+
}
149158
}
150159
}
151160

Coding_iOS/Controllers/RootControllers/Message_RootViewController.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ - (void)viewWillAppear:(BOOL)animated{
9898

9999
- (void)viewDidAppear:(BOOL)animated{
100100
[super viewDidAppear:animated];
101-
[[UnReadManager shareManager] updateUnRead];
102101
}
103102

104103
- (void)didReceiveMemoryWarning

Coding_iOS/Util/OC_Category/UIButton+Bootstrap.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ + (UIButton *)buttonWithStyle:(StrapButtonStyle)style andTitle:(NSString *)title
103103
[btn addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside];
104104
const SEL selArray[] = {@selector(bootstrapStyle), @selector(defaultManager), @selector(primaryStyle), @selector(successStyle), @selector(infoStyle), @selector(warningStyle), @selector(dangerStyle)};
105105
if ([btn respondsToSelector:selArray[style]]) {
106+
#pragma clang diagnostic push
106107
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
107108
[btn performSelector:selArray[style]];
109+
#pragma clang diagnostic pop
108110
}
109111
return btn;
110112
}

0 commit comments

Comments
 (0)