iOS执行drawLayer:incontext,pop操作后闪退

看CA教程,执行完drawLayer后闪退,demo如下

-(void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx{
    
    //线宽
    CGContextSetLineWidth(ctx, 10.0f);
    //线颜色
    CGContextSetStrokeColorWithColor(ctx, [UIColor greenColor].CGColor);
    //画椭圆
    CGContextStrokeEllipseInRect(ctx, layer.bounds);
    
}

是需要释放指针咩?

阅读 3.1k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题