Bug 3817 - RunLoop specification
Summary: RunLoop specification
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: 5.2
Hardware: PC Mac OS
: Low enhancement
Target Milestone: (C9)
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2012-03-08 17:36 UTC by Miguel de Icaza [MSFT]
Modified: 2016-12-30 13:21 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 Miguel de Icaza [MSFT] 2012-03-08 17:36:33 UTC
In our class libraries we sometimes expose APIs like this:


[Export ("scheduleInRunLoop:forMode:")]
void Schedule (NSRunLoop aRunLoop, string mode);

Where the "mode" is one of the NSRunLoopMode NSString constants.   But this is not clear to users because the "mode" is just a string.   

Perhaps we should change this to be "NSString" and introduce an NSRunLoop.XXX set of constants to make it more obvious.

At least we need to document the values in the various places.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-05-17 10:01:16 UTC
We could also add an enum and map from enum value to string value ourselves.

void Schedule (NSRunLoop aRunLoop, RunLoopMode mode)
{
    NSString smode;
    switch (mode) {
    case RunLoopMode.ModeA: smode = NSRunLoop.ModeA; break;
    ...
    }
    Schedule (aRunLoop, smode);
}


enum RunLoopMode {
    ModeA,
    ModeB,
    ModeC,
}
Comment 2 Miguel de Icaza [MSFT] 2012-05-17 11:08:43 UTC
Agreed, I think we should expose both;  The string version for compatibility reasons, the enum version for all known values today.
Comment 3 Sebastien Pouliot 2016-09-15 17:29:16 UTC
https://github.com/xamarin/xamarin-macios/pull/840
Comment 4 Sebastien Pouliot 2016-09-19 12:39:26 UTC
Merged in xamarin-macios/master 3b1586f91b6c41f1220d2ad45d6938d9dcbdb72a