0

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.

4

1 回答 1

1

我可能已经想通了所以别担心!

我的代码中隐藏了一个标志,它阻止了我的方法触发。对不起!

于 2009-10-08T10:09:20.397 回答