菜鸟教程小白 发表于 2022-12-13 05:43:30

ios - tableView reloadData 上的崩溃包括崩溃报告


                                            <p><p>我正在使用 Crashlytics 进行崩溃管理。我最近遇到了这个崩溃,我试图了解为什么会发生这个崩溃。</p>

<p> <img src="/image/dcEi9.png" alt="enter image description here"/> </p>

<p>这是我的<code>UITableView+ReloadTransition.m</code>:</p>

<pre><code>#import &#34;UITableView+ReloadTransition.h&#34;

@implementation UITableView (ReloadTransition)
- (void)reloadDataWithFade:(BOOL)animated {

    [UIView animateWithDuration:0.3 animations:^{
      self.alpha=0.0;
    } completion:^(BOOL finished) {
      ;//line 17
      [UIView animateWithDuration:0.2 animations:^{
      self.alpha=1.0;
      }];
    }];
}
</code></pre>

<p>强烈建议您提供任何帮助吗?在崩溃报告方面,我是个新手。</p>

<p><strong>更新</strong>以包含更多信息。</p>

<p> <img src="/image/1rk28.png" alt="enter image description here"/> </p>

<p> <img src="/image/W4gRh.png" alt="enter image description here"/> </p>

<p> <img src="/image/f4ndc.png" alt="enter image description here"/> </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>尝试混合方法。这样我在重新加载时会淡出表格 View ,希望这对你有所帮助。</p>

<pre><code>@implementation UITableView (Animation)

+(void)load
{
Method original, swizzle;

original = class_getInstanceMethod(self, @selector(reloadData));
swizzle = class_getInstanceMethod(self, @selector(swizzled_reloadData));
method_exchangeImplementations(original, swizzle);
}

-(void)swizzled_reloadData
{
;

CATransition *transition = ;
transition.type = kCATransitionFromBottom;
transition.timingFunction = ;
transition.fillMode = kCAFillModeBackwards;
transition.duration = 0.55;
transition.subtype = kCATransitionFade;
[ addAnimation:transition forKey:@&#34;UITableViewReloadDataAnimationKey&#34;];

}

@end
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于ios - tableView reloadData 上的崩溃包括崩溃报告,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/28898628/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/28898628/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - tableView reloadData 上的崩溃包括崩溃报告