Very basic question about iPhone memory management:
Say I have a viewController with several subviews also controlled by viewControllers. When I remove the top viewController and release the instance – what happens to its children? Are all the therein contained objects released as well?
When I run my app in instruments, I don’t get any memory leaks. But the value for «all Allocations» goes up and up? (I assume that this value is the overall memory consumed by my app?)
View controllers release their view on dealloc. Views release their subviews on dealloc. A release is not a dealloc.
What’s retaining the other view controllers? If your view controller is, then your view controller should release them. Usually this’ll be a property, so you can do self.subViewController = nil.
Additionally, if you have any IBOutlets (and I really hope you’re using properties for these), you’ll also have to set them to nil in dealloc.
Release what you own.