Skip to content

Commit f7e9265

Browse files
guangyaoguangyao
authored andcommitted
Fix
1 parent 793a5d7 commit f7e9265

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

ios/RNNeteaseIm/RNNeteaseIm/ConversationViewController.m

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ - (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+
}
47+
4248
+(instancetype)initWithConversationViewController{
4349
static ConversationViewController *conVC = nil;
4450
static dispatch_once_t onceToken;
@@ -59,6 +65,7 @@ - (instancetype)init {
5965
_redPacketPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:redPackUrl error:nil];
6066
_redPacketPlayer.volume = 1.0;
6167
}
68+
[self addListener];
6269
return self;
6370
}
6471

@@ -67,13 +74,10 @@ -(void)startSession:(NSString *)sessionID withType:(NSString *)type{
6774
_type = type;
6875
_session = [NIMSession session:_sessionID type:[_type integerValue]];
6976
_sessionArr = [NSMutableArray array];
70-
[self addListener];
7177
}
7278
//本地历史记录
7379
-(void)localSessionList:(NSString *)sessionId sessionType:(NSString *)sessionType timeLong:(NSString *)timeLong direction:(NSString *)direction limit:(NSString *)limit asc:(BOOL)asc success:(Success)succe{
7480
// NIMMessageSearchOption *option = [[NIMMessageSearchOption alloc]init];
75-
76-
7781
}
7882

7983
-(void)localSession:(NSInteger)index cerrentmessageId:(NSString *)currentMessageID success:(Success)succe err:(Errors)err{
@@ -720,6 +724,7 @@ - (void)addListener
720724
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
721725
}
722726

727+
723728
#pragma mark - NIMSystemNotificationManagerDelegate
724729
- (void)onReceiveCustomSystemNotification:(NIMCustomSystemNotification *)notification
725730
{
@@ -1112,14 +1117,13 @@ - (void)onTouchVoiceSucc:(Success)succ Err:(Errors)err{
11121117
}
11131118
}];
11141119
}
1115-
11161120
}
11171121

11181122

11191123
-(void)stopSession;
11201124
{
1121-
[[NIMSDK sharedSDK].chatManager removeDelegate:self];
1122-
[[NIMSDK sharedSDK].conversationManager removeDelegate:self];
1123-
[[NIMSDK sharedSDK].systemNotificationManager removeDelegate:self];
1125+
// [[NIMSDK sharedSDK].chatManager removeDelegate:self];
1126+
// [[NIMSDK sharedSDK].conversationManager removeDelegate:self];
1127+
// [[NIMSDK sharedSDK].systemNotificationManager removeDelegate:self];
11241128
}
11251129
@end

0 commit comments

Comments
 (0)