Bug 7280 - Make methods that require an array as their last parameter use params
Summary: Make methods that require an array as their last parameter use params
Status: CONFIRMED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: 5.4.x
Hardware: Macintosh Mac OS
: --- enhancement
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-09-18 16:20 UTC by Yvan Rodrigues
Modified: 2016-02-17 18:56 UTC (History)
2 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 for Bug 7280 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Yvan Rodrigues 2012-09-18 16:20:06 UTC
The standard classes seem to have a lot of methods that require arrays as parameters, often when only one item is required. I would be 23.6% happier if the params keyword was used so I didn't have to muck around with creating arrays. In fact, since many classes have similar property/method pairs e.g. ViewControllers/SetViewControllers, this would actually make the method version more useful.

Examples:

UIActionSheet.ctor
UITabBarController.SetViewControllers
MFMailComposeViewContoller.SetToRecipients
UITabBar.SetItems
Comment 1 Sebastien Pouliot 2012-09-18 17:14:32 UTC
Nice idea! You can likely get this faster (i.e. today) by using extensions methods. We might add them later but we'll keep the original versions (to avoid breaking source compatibility).

Note that UIActionSheet.ctor already ends with params.
Comment 2 Yvan Rodrigues 2012-09-30 11:55:18 UTC
Would it break source compatibility?

UIAlertView.ctor
Comment 3 Rolf Bjarne Kvinge [MSFT] 2016-02-17 18:56:34 UTC
UIAlertView.ctor already has a params ctor.

In any case I'm keeping this open, since it's a nice suggestion and maybe we could somehow automate this in our generator.