更改视图时,pullToRefresh崩溃

时间:2013-03-27 14:26:25

标签: ios objective-c

当我在两个视图之间切换时,在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),它可以正常运行

1 个答案:

答案 0 :(得分:-1)

你可以使用Sonny Parlins的pull刷新库,易于使用,流畅和稳定。

Here is the link of tutorial