当我在两个视图之间切换时,在 4-5 更改我的应用程序崩溃时,我使用僵尸来找出对象被调用,它是
[UIViewController _setViewAppearState:isAnimating:]
我在第一个视图中使用 SVPullToRefresh 库我有一个轮播,第二个是 SVPullToRefreshView
UIViewController 与它一样通用我无法确定崩溃的原因
这是xcode在崩溃时显示的方法
- (void)addPullToRefreshWithActionHandler:(void (^)(void))actionHandler {
LogDebug(@"START - init pull to refresh");
if(!self.pullToRefreshView) {
LogDebug(@"Pull to refresh view is nil, we create it");
SVPullToRefreshView *view = [[SVPullToRefreshView alloc] initWithFrame:CGRectMake(0, -SVPullToRefreshViewHeight, self.bounds.size.width, SVPullToRefreshViewHeight)];
view.pullToRefreshActionHandler = actionHandler;
view.scrollView = self;
[self addSubview:view];
view.originalTopInset = self.contentInset.top;
self.pullToRefreshView = view;
self.showsPullToRefresh = YES;
}
}
这是父调用者
- (void) viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
__block BlogViewController *blockSelf = self;
[self.articleScrollView addPullToRefreshWithActionHandler:^{
LogDebug(@"start refresh");
[blockSelf refresh];
[blockSelf.articleScrollView.pullToRefreshView stopAnimating];
}];
}
编辑:如果我删除测试(!self.pullToRefreshView)
它可以工作,但是分配会堆积起来