简体   繁体   中英

ios7 Deallocation of a UITableView embedded in a UITabBarController

I am just about to submit my first app and I am using Xcode Instruments to perform a memory analysis on my app. I can see that once the view is allocated, the memory is not released, despite selecting another view using the TabBarController .

I have written some code in the function ViewDiddisappear : to set the view to nil. From a persistence point of view it is OK. Additionally the memory not in view is released. However I am not certain if it the best way to release memory not in view. One side effect of this method is that when the view is recreated by the selection of the TabBarController , the view ( TableView ) seems to forget that it in a TabBarController with a navigation bar at the top. The view seems shifted up a bit as if it isn't aware of the navigation bar at the top of the screen.

I have been googling about, both in apple documentation and on the web. It isn't clear what is the best way to deallocate a TableViewController when it isn't in view, and any comments on memory allocation when using TabBarController .

I would appreciate some expertise to help me get my memory management right before I submit the app.

thanks

Tab bar controller allocates memory for all the view controllers inside it. You are using iOS 7 and it supports ARC(Automatic Reference Counting). So, you need not to worry about Tabbar Controller memory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM