开发者

Executing codes in viewDidLoad

开发者 https://www.devze.com 2022-12-24 18:56 出处:网络
In my .m file : (void)viewDidLoad { [super viewDidLoad]; /* Some codes for picker view and slider */ } I used a button to navigate to second view by using the below code:

In my .m file :

  • (void)viewDidLoad { [super viewDidLoad];

/* Some codes for picker view and slider */

}

I used a button to navigate to second view by using the below code:

  • (IBAction)goToPlay{ [self presentModalViewController: secon开发者_Go百科dViewController animated: YES]; }

I used another button to go back to first view by using below code:

  • (IBAction)goBack{ [self dismissModalViewControllerAnimated:YES]; } Now the viewDidLoad method is not calling. I had written some codes in viewDidLoad in first view and I want to execute it when pressing goBack button in second view.

What should I do?

Anyone please help.


Write it in

- (void)viewWillAppear:(BOOL)animated
{

}

method, this would be called every time your view will appear...

0

精彩评论

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

关注公众号