Bug 19430 - MPMediaPlaylist ValueForProperty does not return correct value
Summary: MPMediaPlaylist ValueForProperty does not return correct value
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 7.2.3
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2014-04-30 15:03 UTC by John Miller [MSFT]
Modified: 2014-04-30 17:06 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Repro Project (1.48 MB, application/zip)
2014-04-30 15:03 UTC, John Miller [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description John Miller [MSFT] 2014-04-30 15:03:37 UTC
Created attachment 6684 [details]
Repro Project

Overview: 

When trying to receive playlist titles from iOS using MPMediaPlaylist.ValueForProperty("MPMediaPlaylistPropertyName") it returns an empty string.

Steps to Reproduce: 

1. Run the attached Repro Project on a device that has playlists stored.

Actual Results: 

The playlist title is outputted to the console, and it is empty.

Expected Results: 

It should output the title of the playlist.

Build Date & Platform: 

Xamarin.iOS
Version: 7.2.3.2 (Business Edition)
Comment 1 Sebastien Pouliot 2014-04-30 15:38:23 UTC
From a quick (pre-run) look your sample is using the constant name, not value.

OTOH it seem sour bindings are not optimal : the constant is not available and some API are bound in camelCase :-(
Comment 2 Sebastien Pouliot 2014-04-30 15:50:31 UTC
Confirmed. Replace with "name" and it works. IOW Apple's has something like:

   static NSString MPMediaPlaylistPropertyName = "name";

and the sample is using the constant _name_ not it's value.


I'll keep the bug open because it seems those bindings requires a bit more love (like exposing those constants).
Comment 3 Sebastien Pouliot 2014-04-30 17:06:22 UTC
The constant already exists (even if it's not perfectly exposed in the`MPMediaPlaylistProperty` static class that expose the values.

E.g. 

MPMediaPlaylist.ValueForProperty("MPMediaPlaylistPropertyName")

should be:

MPMediaPlaylist.ValueForProperty (MPMediaPlaylistProperty.Name) 



Other fixes are in master / 9be5c487b663e7c799ca44c2ae41cb2dc5369440