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

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);
    
}

是需要释放指针咩?


问题出在layer.delegate

添加这个

另外关于layer delegate苹果的说明
http://stackoverflow.com/questions/2015353/using-calayer-delegate

【热门文章】
【热门文章】