开发者

MPMediaPickerController in one view and the MPMediaPlayback in another view. How to?

开发者 https://www.devze.com 2023-01-12 04:07 出处:网络
Basically I have a three view stack. In the last view I got a MPMediaPi开发者_高级运维ckerController that lets the user pick a song from his/her library. The song is to be played later from the first

Basically I have a three view stack. In the last view I got a MPMediaPi开发者_高级运维ckerController that lets the user pick a song from his/her library. The song is to be played later from the first view. How can I tell the player (in the first view) what should be played?

One possibility would be to send a notification and include the MPMediaItemCollection as the object maybe?

Is this a/the correct way or do you have other smarter suggestions?


I ended up using NSNotification and attaching the MediaItemCollection as userInfo.


Use the MPMediaPickerController delegate:

in your third view controller set the MPMediaPickerController delegate to be your first view. Implement the delegate callback functions in your first view controller.

0

精彩评论

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