Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

ObjectSharpie Resolutionresult without constructor

l1pton17l1pton17 Member ✭✭

When I created intent definition for ios 13 it add resolve parameter methods.
But class which I should pass to completion callback doesn't have constructor.

It looks like that:

// @interface AddMeasureLevelResolutionResult : INDoubleResolutionResult
[Watch(6, 0), iOS(13, 0)]
[BaseType(typeof(INDoubleResolutionResult))]
interface AddMeasureLevelResolutionResult
{
    // +(instancetype _Nonnull)unsupportedForReason:(AddMeasureLevelUnsupportedReason)reason;
    [Static]
    [Export("unsupportedForReason:")]
    AddMeasureLevelResolutionResult UnsupportedForReason(AddMeasureLevelUnsupportedReason reason);
}

What i should add to this class in order to add constructor?

Posts

  • Did you manage to find a solution to this problem?

    INDoubleResolutionResult has properties like NeedsValue. And methods like GetSuccess(double), but they all return a INDoubleResolutionResult which cannot be passed into the completion method, which expects a subtype of INDoubleResolutionResult.

  • l1pton17l1pton17 Member ✭✭

    @FGoncalvesCayas said:
    Did you manage to find a solution to this problem?

    INDoubleResolutionResult has properties like NeedsValue. And methods like GetSuccess(double), but they all return a INDoubleResolutionResult which cannot be passed into the completion method, which expects a subtype of INDoubleResolutionResult.

    You can change signature in ApiDefinition.cs IntentHandling class "resolve" methods. Replace specific ResolutionResult class in completion parameter to base interface. Hence you can implement this methods and use INDoubleResolutionResult.GetSuccess static methods to obtain class instance.

Sign In or Register to comment.