Using xcode 8 and running on the ios10 simulator. When trying to use MPMoviePlayerViewController, it will immediately cause my sample application to crash in the simulator. No exception or error is shown in Xcode so not sure how to debug this or what is the problem.
MPMoviePlayerViewController *moviePlayer;
moviePlayer = [[MPMoviePlayerViewController alloc] init];
The above code is enough to crash my app in ios 10 simulator. The app closes immediately and nothing show in xcode. No problems at all on the ios 9 simulator.
What can cause this and is there anything to do to debug the crash?
Ok I found the solution,
you have to let the user know what your media player is going to access,
Go to the info.plst and add the key NSAppleMusicUsageDescription - string
add some text (just for testing purposes)
run your app. A dialogue box pops up asking for access to the users media. Hit ok and it should run.
I used your code and ran it this way without a crash.
I hope that works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With