Bug 3817 - RunLoop specification
Summary: RunLoop specification
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
Depends on:
Reported: 2012-03-08 17:36 UTC by Miguel de Icaza [MSFT]
Modified: 2016-12-30 13:21 UTC (History)
4 users (show)

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


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 {
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
Comment 4 Sebastien Pouliot 2016-09-19 12:39:26 UTC
Merged in xamarin-macios/master 3b1586f91b6c41f1220d2ad45d6938d9dcbdb72a

Note You need to log in before you can comment on or make changes to this bug.