开发者

stop play music on dismiss Modal View Controller

开发者 https://www.devze.com 2023-01-26 21:28 出处:网络
dear i need a little help here. i have to views in my project. (view1 and view2). from view1 i can navigate to view2 and i can go back form view2 to view1.

dear i need a little help here. i have to views in my project. (view1 and view2). from view1 i can navigate to view2 and i can go back form view2 to view1. view2 have w back ground music the problem is when the i go back from view2 to view1 the music still play.

t开发者_高级运维o navigate from view1 to view2

[self presentModalViewController:view2 animated:YES];

to return to view1

[self dismissModalViewControllerAnimated:YES];

ii need to make music play when i lunch view2 and stop when return to view1

note: there is any function to teel application that we have navigate to view1 or view2


You can implement these methods in view2 (that I assume is a view controller).

- (void)viewWillAppear:(BOOL)animated

And start the music.

- (void)viewWillDisappear:(BOOL)animated

And stop the music.

0

精彩评论

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