I am almost finished with my first app (long way but fun times)
I am trying for a week to decrease my memory usage of the app but if that does not work i want to make sure it dealloc's a view after its been used but i see that that doesnt happen...
I dont have a memory issue with the searchviewController its more the DetailsViewController that uses 100 mb ram.
I will try to show how my app is build up in a summary:
Searchview controller
The main screen --> UIViewController with tableview
in the didSelectRowAtIndex i have:
DetailsViewController *controller = [[DetailViewsController alloc]initWithNibName:@"DetailsViewController" bundle:nil];
SearchResult *searchResult = [searchResults objectAtIndex:indexPath.row];
controller.searchResult = searchResult;
DetailsViewController
The details screen, is called when select a row, its a UIview that has a subview (a custom scrollview) the custom scrollview has the icarousel (custom uiview)
.h
@property (nonatomic,weak) SearchResult *searchResult;
.m
@property (nonatomic, retain) iCarousel *carousel;
@property (nonatomic, retain) UINavigationItem *navItem;
Implementation:
MGBox *tablesGrid, *table1;
ViewDidLoad:
//Add barButton
UIBarButtonItem *reactButton = [[UIBarButtonItem alloc]..];
carousel = [[iCarousel alloc] init..];
//Add Tablesgrid
tablesGrid = [MGBox boxWithSize:tablesGridSize];
tablesGrid.contentLayoutMode = MGLayoutGridStyle;
[self.scrollview.boxes addObject:tablesGrid];
//Add Table
table1 = MGBox.box;
[tablesGrid.boxes addObject:table1];
after this i have functions that add the searchResult to a label and fill the icarousel (that has max 6 items), icarousel is a uiview that i added as a subview to scrollview etc..
When i push back on the navigationBar and go back to the main view controller it doesn't dealloc the view, why ? (nslogged the dealloc but is never called). After memory warning it calls the ViewDidUnload and makes some memory free but still no dealloc....
I have no reference to other objects right ? except for the searchResult but i set it on weak so it should not be a reference right ?
Some info:
After a search on the mainview i have :
Live bytes: 5,75 mb Living: 27.342 Transistory: 68.200 Overall bytes: 25.30 mb
After selecting a row and going into the detailsViewController i have:
Live bytes: 5.4 mb Living: 32.498 Transistory: 76.488 Overall bytes: 29.55 MB
After dragging the subview row of icarousel (watching the pictures):
Live bytes: 5.5 mb Living: 32.798 Transistory: 122.850 Overall bytes: 36.41 MB
After selecting some tables in the custom table view
Live bytes: 5.7 mb Living: 33.508 Transistory: 161.80 Overall bytes: 40.12 MB
after opening a link in app and going back (opens in modal view and dismiss it again)
Live bytes: 6.7 mb Living: 43.821 Transistory: 371.761 Overall bytes: 144.95 MB
After clicking on the pictures and make the photos in fullscreen and coming back in detailscreenview again (opens modal and dismiss)
Live bytes: 6.76 mb Living: 43.798 Transistory: 400.850 Overall bytes: 155.69 MB
And if i go back to another row it never gets less it just adds
Dont be to hard on me or just shut the topic down for no reason..
Give me some tips or advice or if you dont know what the "problem" is just explain me what these are: Live Bytes - #living - #Transitory - Overall Bytes - # Overall
And i would like to thank this website for all the information that it has because without it i would never got so far