【问题标题】:mono does not port macOS cocoa 100% correctlymono 不能 100% 正确移植 macOS 可可
【发布时间】:2020-07-22 18:53:39
【问题描述】:

我尝试使用 Visual Studio macOS 开发一个使用 c# 语言的 macOS 应用程序。

但我发现单声道有很多错误

例如:

UITabView 有属性 'numberOfTabViewItems' 'tabViewItemAtIndex',但在 VS macOS 中报错。

NSTabView

https://developer.apple.com/documentation/appkit/nstabview?language=objc

using System;
using AppKit;
using Foundation;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;

欢迎您的评论

【问题讨论】:

  • 您是否正在寻找某种关于“VS for MacOS 是最好的 evar”的闲聊?您能否请edit 发帖澄清您到底在寻找什么?

标签: c# macos xamarin xamarin.mac


【解决方案1】:

Xamarin 将 macOS/iOS API 名称标准化为 C# 样式命名:

所以 ObjC numberOfTabViewItems 变成了 Items

Xamarin 的 NSTabView 类:https://docs.microsoft.com/en-us/dotnet/api/appkit.nstabview?view=xamarin-mac-sdk-14

【讨论】:

    猜你喜欢
    • 2020-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-16
    相关资源
    最近更新 更多