开发者

iPhone UIViews sleeping/dying after being brought back into view

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 h开发者_StackOverflow社区and 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.


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜