Bug 32844 - Imprecise use of `Class` (or System.Type) in GameplayKit bindings
Summary: Imprecise use of `Class` (or System.Type) in GameplayKit bindings
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.99 (iOS9 previews)
Hardware: PC Mac OS
: Normal normal
Target Milestone: ios9/Xcode7/OSX10.11
Assignee: Bugzilla
Depends on:
Reported: 2015-08-06 19:56 UTC by Larry O'Brien
Modified: 2015-08-15 14:02 UTC (History)
2 users (show)

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:

Description Larry O'Brien 2015-08-06 19:56:41 UTC
I know that we probably have to track iOS' APIs, which specify AnyClass, but all the GKStateMachine APIs work only with subtypes of GKState.
Comment 1 Sebastien Pouliot 2015-08-09 14:56:35 UTC
The API are using `Class` for which the closest .NET is `System.Type`...

but maybe we can expose this manually with a generic constraint so only GKState (and subclasses) can be specified.
Comment 2 Sebastien Pouliot 2015-08-13 15:45:13 UTC
The GameplayKit types that use `Class` in their selectors are:


* this one is exposed publicly (with `Class`, not `System.Type`)
Comment 3 Sebastien Pouliot 2015-08-15 14:02:00 UTC
I found (and fixed) a few issues after reading more documentation but those API are meant to work on types (not instances) so we cannot change that API (nor restrict it at compile time).

What we can do is to provide helpers methods that accept an (GKState for example) instance and then call the ObjC using the type of that instance. That helps if you already have instance ready of the states.

fixed in maccore/xcode7 8296a2d0a24ad86f075c310a68ca52101bd3af03