bug汇总

2019-11-21  本文已影响0人  守护地中海的花

Hide status bar

 [[UIApplication sharedApplication] statusBarFrame].size.height

获取APPTabBarVC

网络不稳定 脚步刷新

网络不稳定-脚步刷新.png

现象:网络不稳定,当前界面状态是加载数据完毕处于MJRefreshStateNoMoreData 或者mj_footer被删除掉 则都默认会请求
修改

dispatch_async(dispatch_get_main_queue(), ^{
   //如果没有数据 加载第一页的数据 如果有数据加载下一页
   if (weakSelf.dataSource.count == 0)
   {
       [weakSelf loadNewData];
   }
   else
   {
       if (weakSelf.mainView.mj_footer.state != MJRefreshStateNoMoreData && weakSelf.mainView.mj_footer) {
           [weakSelf loadMoreData];
       }
   }
});

如果脚步removeFromSuperview 对象还在 还可以判断的
但是脚步置空 则不行了

验证码清空问题 textfield请求多次

验证码.png

头部刷新速度过快 导致占位图异常

KVO 观察者 与分享的bug

获取界面有音乐播放器 创建音乐播放器的时候加入观察者模式 如果刷新会次添加观察者 ,退出到后台 回来 多次执行 正好 KVO 我这边移除对播放器status的监听 多次重复就崩溃了

#pragma mark - 创建音乐播放
- (void)createMusicPlayer
{
   xxxxxxxxxxxx
   xxxxxxxxxxxxxx
    xxxxxx等创建音乐播放器代码 
    //KVO+监听
    NSKeyValueObservingOptions options = NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld;
    [item addObserver:self forKeyPath:@"status" options:options context:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appwillResignActive:) name:UIApplicationWillResignActiveNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:nil];
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(existVideo:) name:@"existVideo" object:nil];
}
- (void)appwillResignActive:(NSNotification *)note
{
   if (_player)
   {
       [[_player currentItem]removeObserver:self forKeyPath:@"status"];
   }
}

ActivityPageDetailManagerVC.m--434--->:appwillResignActive
ActivityPageDetailManagerVC.m--434--->:appwillResignActive
ActivityPageDetailManagerVC.m--434--->:appwillResignActive

解决方案

if (_player) {
        return;
    }
- (void)appwillResignActive:(NSNotification *)note
{
    NSLog(@"appwillResignActive");
    if (_player)
    {
        @try {
            [[_player currentItem]removeObserver:self forKeyPath:@"status"];
        } @catch (NSException *exception) {
            NSLog(@"%@",exception);
        } @finally {
            
        }
    }
}

我建议以后多些@try 在移除观察者的时候 数组取值的时候 防止越界

关于继承重写问题 倒是YY解析问题

又是一个惊天的bug+失误点.png

刷新导致dealloc不走

dealloc不走.png

改成weakSelf 就OK了

悬停滑动bug+标签控制器数组越界

如果主控制器需要网络请求才可以布局 那么必须在添加managerVC在cell上 判断是否有值


崩溃闪退-滑动问题.png

这个时候cell高度重新来一遍 因为懒加载中 不行了 早已经执行了 rowHeihgt 肯定是0 因为网络加载之后才可以执行createProperty设置初始值 而mainView提前加载 rowHeight 就是0了


WX20200612-095026@2x.png

没有解析取值崩溃

-[__NSDictionaryI url]: unrecognized selector sent to instance 0x281be9c80


image.png image.png

不知不觉的崩溃

启动失败.png

在婚前婚后项目遇到 之前从来没有遇到过 然后我感觉是mob代码搞的 因为mobdemo运行也会出错。
查一下


image.png image.png
上一篇 下一篇

猜你喜欢

热点阅读