leancloud / ChatKit-OC

此项目已经废弃,以后不再维护。我们推出了基于 Swift SDK 的 Chat Demo。

Home Page:https://github.com/leancloud/swift-sdk-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

再次发送语音时,不会弹出录音界面,则录音还在继续

ashen-zhao opened this issue · comments

Base Info for this issue

  1. ChatKit Version:v0.8.5
  2. App-ID: XX
  3. Language:Objective-C
  4. iOS System Version:iOS12
  5. Prototype(是否是真机):YES
  6. Issue Type:Crash、Bug、Enhancement(希望能支持一个新需求)、Q-A

1. How to repeat the problem.

发送语音时,第一次会弹出录音倒计时,再此录音则不会弹出倒计时弹框,而录音在继续进行;

2. Please help me in this way.

我发现在这个LCCKProgressHUD.m 中的 109-117行的代码,我注释掉,就可以正常录音,不知道这里的代码有何用处;
尤其是这里 [windows removeObject:self.overlayWindow]; 为什么移除一个新建的对象,而对象没有使用。
代码如下:
NSMutableArray *windows = [[NSMutableArray alloc] initWithArray:[UIApplication sharedApplication].windows];
[windows removeObject:self.overlayWindow];

                             [windows enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(UIWindow *window, NSUInteger idx, BOOL *stop) {
                                 if([window isKindOfClass:[UIWindow class]] && window.windowLevel == UIWindowLevelNormal) {
                                     [window makeKeyWindow];
                                     *stop = YES;
                                 }
                             }];