search

Home  >  Q&A  >  body text

ios - CAAnimation 的 delegate 用 strong的原因是?

IOS中,CAAnimation 这个类的 @property(nullable, strong) id delegate; 这个delegate用 strong的原因是?

PHP中文网PHP中文网2772 days ago910

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:46:20

    Are you worried that the strong delegate will cause circular references? The situation here is different from the general delegate. First of all, the animation is asynchronous. During the animation process, its delegate may be released at any time. If it is not a strong reference, for example, the user clicks return. On the other hand, generally you don't hold a strong reference to a CAAnimation (unlike a UITableView). The documentation also says that this is an exception to the memory management rules.

    reply
    0
  • Cancelreply