I've searched a lot but unlucky didn't find a similar one that could solve my problem.
For example, I'm not using delegate so strong delegate pointer is not the problem.
There is a UItabbarcontroller as a root view controller. After loading that tab bar controller, it will present a view controller (modally) on top. Once that view controller finished its job, dismiss the view controller and get back to TabBarController. The reason for this is in that view controller it has a background image which consumed about 10mb memory.
I present the view controller in -viewDidAppear:
- (void)viewWillAppear:(BOOL)animated
{
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if ([userDefaults valueForKey:@"token"]==NULL) {
UIStoryboard *storyboard = [self storyboard];
UINavigationController *navController = [storyboard instantiateViewControllerWithIdentifier:@"SignInNavigationController"];
[self presentViewController:navController animated:NO completion:nil];
}
}
That navigation controller is root controller of that view controller. (I hope this is not the problem)
And this is how I dismiss the view controller:
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
There is no other connection between them.
EDIT: Someone asked about what is the question, so my question is since that view controller is dismissed, the memory of that should be collected back right? Or if not, is there anyway to collect it back?
(ARC of course)