How should I manage the memory allocated for the UIView returned from viewForHeaderInSection?
I'm about to implement the UITableViewDelegate::viewForHeaderInSection method, where I plan to allocate and init a new UIView object and return it. I'm new to iOS development, but I'm trying to adhere to the general rule of thumb that if I create it, I'm responsible for deleting it, but I can figure out how the UIView object is handled after I pass it on to the UITableView. Should I autorelease the UIView object? Should I store it in an instance var and release it in my dealloc?
Thanks for your help!
I would autorelease the UIView.
I would only store it in an instance variable if you need an reference to it later.