2012-03-05 23 views
1

我在我的應用程序中有髒內存大小的問題,並希望清除髒內存。 Instruments由於CoreAnimation和CG圖像髒內存

我的應用程序越來越大。但主要問題是CoreAnimationCG Image類型。 Memory Tag 70通過我的Assync Image Load View清除。

如何從髒內存中清除CoreAnimation和CG圖像?居民57%的髒記憶對我來說似乎有點高。

回答

2

也許你還沒有釋放了他們,用CGImageRelease(cgImage)CGPathRelease(path);等像:

CGImageRef cgImage = CGImageCreateWithImageInRect(fullImage.CGImage, CGRectMake(...)); 
UIImage * image = [UIImage imageWithCGImage:cgImage]; 
CGImageRelease(cgImage); 

和核心動畫的路徑

CGMutablePathRef path = CGPathCreateMutable(); 
... 
CGPathRelease(path); 

等。

+0

我不使用'CGImageRef'和,我使用的唯一的動畫是導航過渡和像這樣的翻動過渡:[UIView的setAnimationTransition:(UIViewAnimationTransitionFlipFromLeft) forView:self.view 緩存:YES]; – mariusLAN 2012-03-05 08:13:00

+0

@mariusLAN媽媽..我認爲這個不會導致這個問題,你最好在你的問題中使用CGImage和Core Animation的地方發佈更多的代碼。 – Kjuly 2012-03-05 08:23:07

+0

我沒有使用CGImage或Core Animations。我只使用標準的'UIImageViews'和提供動畫的能力。 – mariusLAN 2012-03-05 08:28:29