• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

UIViewController动画停止工作

用户头像
it1352
帮助1

问题说明

我的应用程序在iOS6中运行良好,但是在未指定的即将推出的iOS版本中,由于NDA原因我无法命名,所有 UIViewController 过渡动画都停止工作。新视图立即就位。我不确定这个未指定的iOS未来版本是否是原因,因为我在iOS6中偶尔会看到这种情况。

My app runs fine in iOS6, but in an unspecified upcoming version of iOS that I cannot name for NDA reasons, all UIViewController transition animations stop working. New views just pop into place instantly. I am not sure if this unspecified future version of iOS is the cause, as I've seen this happen occasionally in iOS6.

有时动画开始工作一段时间然后不久后停止,让我觉得这是某种内存警告问题,但我的应用程序在大多数情况下使用相当合理的~125MB RAM。任何人都可以提供任何建议或事情来调查吗?

Sometimes animations start working for a while and then stop shortly after, making me think it's some sort of memory warning issue, but my app is using a fairly reasonable ~125MB of RAM at most times. Can anyone offer any advice or things to investigate?

正确答案

#1

所描述的行为一直存在:如果你在背景线程上工作,然后调用和UIKit方法,然后通常会以一种奇怪的方式延迟更新。

The described behavior has always existed: if you do work on background threads and then call and UIKit methods then more often than not the update will be delayed in a weird way.

因此你应该总是 dispatch_async 进入主队列以更新UI。

Because of this you should always dispatch_async onto the main queue to update the UI.

这些错误很难捕获,因为它们并不总是可预测地发生。

Those bugs are very hard to catch since they do not always occur predictably.

为了捕获它们,我构建了一个方法,它调用一些UIKit方法来检查它们是否在主线程上被调用。这样,只要忘记发送回主队列,就可以停止符号断点。

To catch them I built a method that swizzles some UIKit methods to check if they are called on the main thread. This allows you to stop on a symbolic breakpoint, whenever you have forgotten to dispatch back onto main queue.

https://github.com/Cocoanetics/DTFoundation/blob/develop/Core/Source/iOS/Debug/UIView+DTDebug。 m

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcbjbea
系列文章
更多 icon
同类精品
更多 icon
继续加载