你好
我看到之前的人也有累世问题,我照着做了修改。有些不明白的地方所以问一下:
我的大致流程是:
1.刚登录用的是一下方法
videoChatController = [[VideoChatController alloc] init]; videoChatController.view.frame = self.view.bounds; [videoChatController initLunchBody:self.lunchMeetBody]; iCurrentChatUserId = -1; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(AnyChatNotifyHandler:) name:@"ANYCHATNOTIFY" object:nil]; anychat = [[AnyChatPlatform alloc] init]; anychat.notifyMsgDelegate = self; anychat.textMsgDelegate = self;
[AnyChatPlatform InitSDK:0]; [self loginAnyChat];
退出时 -(void)leaveRoom{ //我将自己的视屏和对方的分开了 if (isVideoChat) { [videoChatController FinishLocalVideoChat]; [videoChatController FinishOtherVideoChat]; } else{ ZNLog(@"the model s %d %d",isWordChat,isVideoChat); [videoChatController FinishLocalVideoChat]; }
[AnyChatPlatform LeaveRoom:-1]; iCurrentChatUserId = -1; [self performSelector:@selector(leaveRoomStep2) withObject:nil afterDelay:0.3]; }
-(void)leaveRoomStep2{
[AnyChatPlatform Logout]; // [self showLoginView];
// [anychat release]; // [AnyChatPlatform Release];
} 刚开始我把 [AnyChatPlatform Release]; 加上的 但第二次退出时就Crash了,看了你们的帖子说在app退出时再释放资源 所以我把它放到 - (void)applicationWillTerminate:(UIApplication *)application {
[AnyChatPlatform Release];
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
} 再次进入时流程同上 请问 我的流程有问题吗另外 一开始时候初始化的anychat 同样能释放 否则在进入时也进入不了
|