首页 > 解决方案 > mono 不能 100% 正确移植 macOS 可可

问题描述

我尝试使用 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;

在此处输入图像描述

在此处输入图像描述

欢迎您的评论

标签: c#macosxamarinxamarin.mac

解决方案


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

所以 ObjCnumberOfTabViewItems就变成了Items

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


推荐阅读