2

I currently find a really wired problem when I using the statement with stroyboard

SomeViewController *homeView = [self.storyboard instantiateViewControllerWithIdentifier:@"someID"];
[self.navigationController pushViewController:homeView animated:YES completion:NULL];

and when I using

[self.navigationController popViewControllerAnimated:YES];

in the view Controller that I have pushed, the memory did not get dealloc (I am using ARC)

However, if I use

[self performSegueWithIdentifier:@"pushToHomeView" sender:self];

when I pop from the homeView's memory get freed.

I really want to why the push a view programatically will give me this problem.

John Conde
  • 217,595
  • 99
  • 455
  • 496
Lei
  • 318
  • 1
  • 6

1 Answers1

0

I think pushing a view programs only works for xib files and segue for storyboard. When using segue with arc memory automatically gets freed. This the function that is built in arc with storyboard. That is what I found out with storyboards. I came a cross of this in one of my projects and finally concluded that perform segue is freeing up the memory. Hope this could help, but this is just my experience. Adrian

Adrian P
  • 6,479
  • 4
  • 38
  • 55
  • Thanks, I was confused by this problem by a long time and I can not find a reason why pushviewcontroller in stroyboard will be like this. Anyway, segue works fine which mean I donot have to push – Lei Oct 16 '12 at 02:46