views:

52

answers:

1

Hi, I need some help. This seems to be a common problem I am having when am adding and changing views in my coding. And I would love to learn what I am doing wrong.

Currently I am adding and removing views using the following calls from my view controller:

[startView removeFromSuperview];
[self addSubview:secondView];

and then doing the opposite again to go back.

[secondView removeFromSuperview];
[self addSubview:startView];

I am fine up to this point. But the problem I have is that when I then decide to go back to 'startView" and call the first code that I have above for the second time. My View loads but very little works. None of my methods are called, there is no animation and the view is shown but it is "dead" or "asleep". And I have no idea why!

I am basically adding a view, removing it, then adding it again and everything breaks. Can anyone give me a hand as to what might be happening? is it that ViewDidLoad doesn't fire the second time it's loaded? or something like that? I would much appreciate it.

+1  A: 

I may have figured it out So don't worry!

I had a flag hidden in my code somewhere that was stopping my methods from firing. Sorry!

JordanC