I am trying to get a list of media on the device using the MPMediaQuery and I'm having a bit of trouble with the method signature. I need an MPMediaQuery with an MPMediaPropertyPredicate where the property is MPMediaItem.MediaTypeProperty and value is Music.
var query = new MPMediaQuery (); var predicate = MPMediaPropertyPredicate.PredicateWithValue (MPMediaType.Music, MPMediaItem.MediaTypeProperty); query.AddFilterPredicate (predicate);`
Trouble is, PredicateWithValue expects an NSObject and a String, MPMediaType.Music is an enum/nint. Which cannot be cast to an NSObject. Is this a regression bug in Xamarin, or am I using this code incorrectly? The official Apple documentation seems to suggest that this method should accept an NSString/string, rather than NSObject.