开发者

iPhone images still stored in memory?

So I have several viewControllers, each creates images using "imageWithContentsOfFile" in order to conserve memory and then sets objects to nil and releases them in the dealloc method. There are no memory leaks. The problem is memory still builds up when switching views. So for example I'll be in view1 and it'll be using 8MB of memory and then I'll switch to view2 and back to view1 again and it'll be now using 10MB of memory. I've checked allocations in in开发者_如何学运维struments and it's the images using it. Is there something I need to do to flush the memory out or something?

Thanks in advance!


Shouldn't you be calling [object release] before setting object = nil?

Sorry, I'm at home and I don't have a mac here so I can't test what happens when you do it the other way around.

Also, by saying there are no leaks, did you check using the Leaks tool? I don't think the tool detects all leaks, as I've tried putting a leak on purpose but Leaks wasn't able to see it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜