Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RooneyCS

macrumors newbie
Original poster
Mar 31, 2011
8
0
Cornelius NC
I'm blowing through memory, though no leaks, and would appreciate some additional eyes on my basic architecture - tia!

First, this is my first iPad app, though I'm very experienced in iOS, iPhone and touch.

The app is an employee directory, and fundamentally stays on one view throughout the life of the app. All data is kept in SQLite tables. I'm using XCode 3.2.6, and iOS 4.3.2.

1. I'm using a UITabBarController with the app delegate, and one of the tabbed views is essentially the main view of the app, which itself uses two subviews within the main view, think UISplitViewController, (which can't be used as a subview of a tab bar).

2. In the "master" view, which is, as I mentioned, simply a UIView within a UIViewController, I have a UISearchBar. Users tap in employee names, which I then populate through to a UITableView just below the search bar, using a "Google Instant Search" technique, populating names which contain the letters as they are entered.

3. The user taps a name in the tableView. I then fetch the appropropriate SQL data and populate the right side "detail" view, which has a number of UILabels, and one of the subviews of this detail view is a UITableView which shows the selected employee and how that person fits within the corporate hierarchy, with superiors above and any subordinates below their name.

4. The user can tap any name within the hierarchy view to view that employee's full data, redrawing and reusing all of the UILabels and hierarchy tableView. The data arrays used in the tableView process are cleared and repopulated from the SQLite data tables, prior to the reload/redraw.

5. There are zero memory leaks, but watching with Instruments, every time I tap a new employee and display the right side "detail" view, I'm adding 5MB in allocation, with no releases. Needless to say, a couple of taps and my low memory warning is going off.

In iPhone, I would return to a previous page, which would autorelease the "detail" memory in a modal subview. I mistakenly assumed (I know, bad word) that the UILabels in the "detail" view would autorelease, but not happening.

The big question: how do I release the existing "detail" view, with all of it's subviews. All of the views are created in IB, and I'm using a custom UITableViewCell in the hierarchy tableView, and all cells are being reused efficiently.

I'm sure this will seem so bloody obvious to all but me, but I've spent days making sure all memory was released, and even debating whether the autorelease pool was not being called effectively.

Thanks a bunch!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.