有没有办法取消动画UITableView / UIScrollView setContentOffset:动画:? [英] Is there a way to cancel an animated UITableView/UIScrollView setContentOffset:animated:?

查看:490
本文介绍了有没有办法取消动画UITableView / UIScrollView setContentOffset:动画:?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序在动画时释放我的 UITableView 时崩溃。只要动画完成,应用程序就可以正常运行。下面是点击 UIButton 的结果,它调用 [tableView setContentOffset:offset animated:YES]; 然后快速点击 backBarButtonItem ,弹出 UITableViewController

My app is crashing when my UITableView is released whilst animating. The app functions without issue so long as the animation completes. Below is the result of a tap on the UIButton which calls [tableView setContentOffset:offset animated:YES]; and then a lightning quick tap on the backBarButtonItem which pops the UITableViewController:

#0  0x31ec3ebc in objc_msgSend
#1  0x33690248 in -[UIScrollView(UIScrollViewInternal) _scrollViewAnimationEnded]
#2  0x30defa14 in -[NSObject performSelector:withObject:]
#3  0x33690098 in -[UIAnimator stopAnimation:]
#4  0x3368fb7c in -[UIAnimator(Static) _advance:]
...

我从未见过 _scrollViewAnimationEnded 的崩溃,显然谷歌也没有。我试过从 UITableViewController [tableView setContentOffset:offset animated:NO]; > - (void)viewWillDisappear:(BOOL)动画方法,但这并没有解决问题。

I've never seen a crash on _scrollViewAnimationEnded and apparently neither has Google. I have tried calling [tableView setContentOffset:offset animated:NO]; from the UITableViewController's - (void)viewWillDisappear:(BOOL)animated method, but this did not solve the issue.

任何停止<$的想法动画中的c $ c> UITableView 或 UIScrollView

推荐答案

这看起来可能是委托问题。你是否有一个表的委托,如果是,那么当表是dealloc'd?在释放tableView的委托之前尝试nil'ing。

This looks like it might be a delegate issue. Do you have a delegate for the table, and, if so, is it dealloc'd when the table is? Try nil'ing out your tableView's delegate before releasing it.

[表格由CoreAnimation保留,同时它是动画,所以这可能不是问题。]

[The tableView is retained by CoreAnimation while it's animating, so that's probably not the problem.]

这篇关于有没有办法取消动画UITableView / UIScrollView setContentOffset:动画:?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆