Bug 5849 - NSFileManager.GetMountedVolume() falsely requires an NSArray instead of string[]
Summary: NSFileManager.GetMountedVolume() falsely requires an NSArray instead of string[]
Status: VERIFIED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: Master
Hardware: PC Mac OS
: Normal normal
Target Milestone: 2.0.x
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2012-06-25 15:05 UTC by Timo Dörr
Modified: 2015-03-04 07:54 UTC (History)
4 users (show)

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

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:
VERIFIED FIXED

Description Timo Dörr 2012-06-25 15:05:39 UTC
just reported that on IRC, now filling a bug report as requested:

The FileManager.GetMountedVolume() function requires an NSArray as 1st parameter, which should actually be a string[]. The APIdoc to the according function:
http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/instm/NSFileManager/mountedVolumeURLsIncludingResourceValuesForKeys:options:

also says that it can be null.
Comment 1 Miguel de Icaza [MSFT] 2012-06-25 15:24:04 UTC
We could add a compatibility function that does something about it, but it could not be a virtual method that replaces the existing method, as it would break existing users. 

Something like this helper:


public NSUrl[] GetMountedVolumes(NSObject [] properties, NSVolumeEnumerationOptions options)
{
    return GetMountedVolumes (NSArray.FromObjects (properties), options)
}
Comment 2 Timothy Risi 2015-02-20 21:42:11 UTC
Fixed on master / 714ee6b4dd94e029de6d09a83a79c56609b6e391
Comment 3 Rajneesh Kumar 2015-03-04 07:54:51 UTC
I have checked this issue with the following builds:

=== Xamarin Studio ===
Version 5.9 (build 120)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
Mono 4.0.0 ((detached/51d34c6)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400000028
Apple Developer Tools Xcode 6.1 (6604)
Build 6A1052d
Xamarin.Mac Version: 2.0.0.1 (Business Edition)
=== Build Information ===
Release ID: 509000120
Git revision: f5e41538f5c8635b6c00fb22f522c1de4f6509b0
Build date: 2015-03-03 17:56:32-05
Xamarin addins: 564d7bb0d7d0bc4440c14e7baf16db2fadb76975
Operating System
Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
Sun Aug 17 19:50:11 PDT 2014
root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64

Bow, I observed that the FileManager.GetMountedVolume() function requires an NSString[] as 1st
parameter. Here is the screenacst for the same: http://www.screencast.com/t/TVTcMEwB4

This issue has been fixed, hence I am closing this issue.