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!

Answers


I would autorelease the UIView.

I would only store it in an instance variable if you need an reference to it later.


Need Your Help

How check fast, if database reachable? (Qt, QML, C++)- Linux

c++ linux database qt qml

I use qt with qml and c++. On my application i use a database.

i saw the code of starting other apps from my app.but i came to K little bit ..i need some detailed ebooks on intents and start activity

java android eclipse

i saw the code of starting other apps from my app.but i understood little bit ..i need some detailed ebooks on intents and start activity ON ANDROID...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.