Is there a way to cancel an animated UITableView/UIScrollView setContentOffset:animated:?(有没有办法取消动画 UITableView/UIScrollView setContentOffset:animated:?)
问题描述
当我的 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
发生崩溃,显然 Google 也没有.我尝试从 UITableViewController
的 - (void)viewWillDisappear:(BOOL)animated
调用 [tableView setContentOffset:offset animated:NO];
方法,但这并没有解决问题.
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.
在动画制作过程中停止 UITableView
或 UIScrollView
有什么想法吗?
Any ideas for stopping a UITableView
or UIScrollView
in the midst of animating?
推荐答案
这看起来可能是委托问题.您是否有该表的代表,如果有,当该表存在时是否已解除分配?在释放它之前尝试将你的 tableView 的委托归零.
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 在动画时会保留 tableView,所以这可能不是问题.]
[The tableView is retained by CoreAnimation while it's animating, so that's probably not the problem.]
这篇关于有没有办法取消动画 UITableView/UIScrollView setContentOffset:animated:?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有没有办法取消动画 UITableView/UIScrollView setConte


- android 4中的android RadioButton问题 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01