1

我确实理解静态类不能声明实例成员,但是这是由于生成了

编译器的输入:APIDefinition.cs

// @interface CallKitIntegration (TVOCall)
[Category]
[BaseType(typeof(TVOCall))]
interface TVOCall_CallKitIntegration
{
    // @property (nonatomic, strong) NSUUID * _Nonnull uuid;
    [Export("uuid", ArgumentSemantic.Strong)]
    NSUuid Uuid { get; set; } 

中间编译器输出:TVOCall_CallKitIntegration.g.cs

namespace TwilioVoiceBindingBeta19 {
public unsafe static partial class TVOCall_CallKitIntegration  {

    [CompilerGenerated]
    static readonly IntPtr class_ptr = Class.GetHandle ("TVOCall");

    [CompilerGenerated]
    public virtual NSUuid Uuid {
        [Export ("uuid", ArgumentSemantic.Retain)]
        get {
            NSUuid ret;
            if (IsDirectBinding) {
                ret =  Runtime.GetNSObject<NSUuid> (global::ApiDefinition.Messaging.IntPtr_objc_msgSend (this.Handle, Selector.GetHandle ("uuid")));
            } else {
                ret =  Runtime.GetNSObject<NSUuid> (global::ApiDefinition.Messaging.IntPtr_objc_msgSendSuper (this.SuperHandle, Selector.GetHandle ("uuid")));
            }
            return ret;
        }

在此处输入图像描述

导致正确生成 g 文件的 APIDefinition 的正确更改是什么?

4

1 回答 1

1

改成这个

// @interface CallKitIntegration (TVOCall)
[Category]
[BaseType(typeof(TVOCall))]
interface TVOCall_CallKitIntegration
{
  // @property (nonatomic, strong) NSUUID * _Nonnull uuid;
  [Export("uuid")]
  NSUuid Get_Uuid()

  [Expoer("setuuid:")]
  void Set_Uuid(NSUuid value);
于 2017-11-03T09:45:10.180 回答