开发者

How to call viewWillAppear delegate method of detail view of split view in ipad?

I am developing an application where I programmed button actions in the detail view of split view.

On clicking the button actions, a modal view will open.

Now I need to call viewWillAppear delegate of the detail view where I took button actions when dismissing modal view, but I can't find how to do that.

Can anyone poi开发者_开发问答nt me to the right direction?


You are approaching the problem wrong.

On iOS, whether iPad or iPhone or Ipod Touch, modal views work the same way. They get pushed on top of the view stack, and then they get popped off when you dismiss them. When they do pop, the previous view in the view stack is displayed again.

The methods viewWillAppear, viewDidAppear, and their unloading counterparts, should not be called manually, since iOS manages that.

Based on these two ideas, when your modal view gets dismissed and popped, you should perform your management inside viewWillAppear.

Edit: found a link that explains viewDidLoad is not called on the caller when dismissing modal view, but viewWillAppear is. The reason is, unloading the view is done by the OS if it decides to for memory reasons, you have no control on that.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜