下面的代码让我的应用程序慢如蜗牛(这会导致内存泄漏,我认为):CALayer导致内存泄漏?
CALayer *layer = [[CALayer layer] retain];
detailcell.layer.borderColor = [UIColor grayColor].CGColor;
detailcell.layer.borderWidth = 2;
detailcell.layer.shadowColor = [UIColor blackColor].CGColor;
detailcell.layer.shadowOpacity = 1.0;
detailcell.layer.shadowRadius = 5.0;
detailcell.layer.shadowOffset = CGSizeMake(0, 3);
detailcell.layer.cornerRadius = 20;
detailcell.clipsToBounds = NO;
[layer release];
的“detailcell”是一个UIView,我创建一个边框和阴影。如果我省略代码,我的应用程序运行完美。在通过互联网研究问题后,CALayer *layer = [[CALayer layer] retain];
应该是解决方案,但问题仍然存在。有没有人有想法解决这个问题?
非常感谢!