我遇到了内存管理问题,终于找到了问题,我不断实例化新的视图控制器。当应用程序启动时,它直接进入情节提要中FirstViewController
的元素。UITabBarController
然后我FilterViewController
用这个方法展示:
- (IBAction)searchOptions:(id)sender {
FilterViewController *ctrl = [[FilterViewController alloc] init];
[UIView transitionFromView:self.view toView:ctrl.view duration:1
options:UIViewAnimationOptionTransitionCurlUp completion:nil];
self.filterViewController = ctrl;
[self.navigationController pushViewController:self.filterViewController
animated:NO];
}
哪个工作正常并提出了FilterViewController
哪个有自己的.xib,所以它不在情节提要中。
现在,当尝试弹回时,FirstViewController
我使用此方法:
- (IBAction)backToMap:(id)sender {
// i used the below when trying to push another view controller
/*UIStoryboard *storyboard = [UIStoryboard storyboardWithName
:@"MainStoryboard" bundle:nil];
FirstViewController *fvc = [storyboard
instantiateViewControllerWithIdentifier:@"FirstViewController"];
fvc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;*/
[self.navigationController popViewControllerAnimated:YES];
}
然而它没有做任何事情。什么都没有,我看不出这里有什么问题?