When I use UIImage imagenamed: should I set the variables which hold UIImages to nil before exit? I notice that sometimes when I switch between views which have UIImages, the memory keeps growing and growing with each switch back and forth.
Share
Setting variables to nil is not necessary.
Setting properties to nil (
self.property = nil;) will release them if they’re declared@property (retain).Since
+imageNamed:doesn’t start with “alloc”, “copy”, “new”, or “retain”, you don’t have to release it. It’s possible things are staying in memory because the space isn’t needed. Are you seeing any leaks or just memory usage?