我使用Crashlytics进行崩溃管理。我最近遇到了这次崩溃,我试图理解为什么会发生此次崩溃。
这是我的UITableView+ReloadTransition.m
:
#import "UITableView+ReloadTransition.h"
@implementation UITableView (ReloadTransition)
- (void)reloadDataWithFade:(BOOL)animated {
[UIView animateWithDuration:0.3 animations:^{
self.alpha=0.0;
} completion:^(BOOL finished) {
[self reloadData];//line 17
[UIView animateWithDuration:0.2 animations:^{
self.alpha=1.0;
}];
}];
}
强烈建议任何帮助?对于崩溃报告,我是一个新手。
更新以包含更多信息。
答案 0 :(得分:1)
尝试调配方法。这样我就重新加载表格视图,希望这对你有帮助。
@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
{
[self swizzled_reloadData];
CATransition *transition = [CATransition animation];
transition.type = kCATransitionFromBottom;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
transition.fillMode = kCAFillModeBackwards;
transition.duration = 0.55;
transition.subtype = kCATransitionFade;
[[self layer] addAnimation:transition forKey:@"UITableViewReloadDataAnimationKey"];
}
@end