【问题标题】:Infinite loop when adding CATiledLayer to UIView将 CATiledLayer 添加到 UIView 时出现无限循环
【发布时间】:2010-04-06 15:00:59
【问题描述】:

我有一个 UIView,我在其中添加了一个 CATiledLayer 并实现了“drawLayer”。 如果我使用 UIViewController 并将图层添加到控制器的新子视图中,那么一切正常。

但是,如果我尝试使用 UIView 并在其中执行所有创建和绘图,那么当我将此视图添加到超级视图时,我会在下面显示的点处获得无限循环。

0x002cfafb  <+0425>  ja     0x2cfa23 <-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]+209>

我错过了什么?

更新: 通过删除'layer.delegate = self',代码不再崩溃......

【问题讨论】:

    标签: iphone cocoa-touch iphone-sdk-3.0


    【解决方案1】:

    刚刚找到这个:

    http://www.iphonedevsdk.com/forum/iphone-sdk-development/18121-calayer-interesting-crash.html

    “你不能将delegate设置为与view的layer的delegate相同,默认情况下就是view本身”

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-26
      • 1970-01-01
      • 2012-02-23
      相关资源
      最近更新 更多