Skip to content

Commit f91b35a

Browse files
guangyaoguangyao
authored andcommitted
Fix
1 parent 032d1c3 commit f91b35a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

ios/RNNeteaseIm/RNNeteaseIm/ConversationViewController.m

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ - (void)viewDidLoad {
3939

4040
}
4141

42-
- (void)dealloc{
43-
[[NIMSDK sharedSDK].chatManager removeDelegate:self];
44-
[[NIMSDK sharedSDK].conversationManager removeDelegate:self];
45-
[[NIMSDK sharedSDK].systemNotificationManager removeDelegate:self];
46-
}
4742

4843
+(instancetype)initWithConversationViewController{
4944
static ConversationViewController *conVC = nil;
@@ -65,7 +60,6 @@ - (instancetype)init {
6560
_redPacketPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:redPackUrl error:nil];
6661
_redPacketPlayer.volume = 1.0;
6762
}
68-
[self addListener];
6963
return self;
7064
}
7165

@@ -74,6 +68,7 @@ -(void)startSession:(NSString *)sessionID withType:(NSString *)type{
7468
_type = type;
7569
_session = [NIMSession session:_sessionID type:[_type integerValue]];
7670
_sessionArr = [NSMutableArray array];
71+
[self addListener];
7772
}
7873
//本地历史记录
7974
-(void)localSessionList:(NSString *)sessionId sessionType:(NSString *)sessionType timeLong:(NSString *)timeLong direction:(NSString *)direction limit:(NSString *)limit asc:(BOOL)asc success:(Success)succe{
@@ -1122,8 +1117,8 @@ - (void)onTouchVoiceSucc:(Success)succ Err:(Errors)err{
11221117

11231118
-(void)stopSession;
11241119
{
1125-
// [[NIMSDK sharedSDK].chatManager removeDelegate:self];
1126-
// [[NIMSDK sharedSDK].conversationManager removeDelegate:self];
1127-
// [[NIMSDK sharedSDK].systemNotificationManager removeDelegate:self];
1120+
[[NIMSDK sharedSDK].chatManager removeDelegate:self];
1121+
[[NIMSDK sharedSDK].conversationManager removeDelegate:self];
1122+
[[NIMSDK sharedSDK].systemNotificationManager removeDelegate:self];
11281123
}
11291124
@end

0 commit comments

Comments
 (0)