views:

54

answers:

1

Hello,

the following code makes my app slower as a snail (it causes a memory leak i think):

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];

The "detailcell" is a UIView and i create a border and a shadow. If i omit the code, my app runs perfect. After researching the problem via the internet, CALayer *layer = [[CALayer layer] retain]; should be the solution, but the problem is still there. has anyone got an idea to solve the problem?

Thank you very much!

A: 

Got nobody an idea? If i subclass my label and add this to the subclass, will it work better?

Thanks for help!!

Jonathan