xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.49k stars 515 forks source link

Expose CKQueryOperation.maximumResults #19013

Closed tipa closed 1 year ago

tipa commented 1 year ago

Steps to Reproduce

Try to use CKQueryOperation.maximumResults

Expected Behavior

Constant is exposed

Actual Behavior

Constant is not exposed https://github.com/xamarin/xamarin-macios/blob/862e232ef38cc8b1d95c7764b83426c5ac67edaf/src/cloudkit.cs#L1499-L1501

Environment

Version information ``` Visual Studio Community 2022 for Mac Version 17.6.4 (build 472) Installation UUID: b5d3e74e-eb3b-4fbc-b91f-55cd6a62670e Runtime .NET 7.0.3 (64-bit) Architecture: Arm64 Microsoft.macOS.Sdk 13.1.1007; git-rev-head:8afca776a0a96613dfb7200e0917bb57f9ed5583; git-branch:release/7.0.1xx-xcode14.2 Roslyn (Language Service) 4.6.0-3.23180.6+99e956e42697a6dd886d1e12478ea2b27cceacfa NuGet Version: 6.4.0.117 .NET SDK (Arm64) SDK: /usr/local/share/dotnet/sdk/7.0.401/Sdks SDK Versions: 7.0.401 6.0.414 MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks .NET Runtime (Arm64) Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 7.0.11 6.0.22 Xamarin.Profiler Version: 1.8.0.49 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler Updater Version: 11 Apple Developer Tools Xcode: 14.3.1 21815 Build: 14E300c Xamarin.Mac Version: 9.3.0.6 Visual Studio Community Hash: 97731c92c Branch: xcode14.3 Build date: 2023-04-11 22:38:35-0400 Xamarin.iOS Version: 16.4.0.6 Visual Studio Community Hash: 97731c92c Branch: xcode14.3 Build date: 2023-04-11 22:38:36-0400 Xamarin Designer Version: 17.6.3.9 Hash: 2648399ae8 Branch: remotes/origin/d17-6 Build date: 2023-09-07 02:05:20 UTC Xamarin.Android Not Installed Microsoft Build of OpenJDK Java SDK: Not Found Eclipse Temurin JDK Java SDK: Not Found Android SDK Manager Version: 17.6.0.50 Hash: a715dca Branch: HEAD Build date: 2023-09-07 02:05:26 UTC Android Device Manager Version: 0.0.0.1309 Hash: 06e3e77 Branch: HEAD Build date: 2023-09-07 02:05:26 UTC Build Information Release ID: 1706040472 Git revision: 0b8c2cb9f01ef14a2b07ff4ea047268c8756fee6 Build date: 2023-09-07 02:03:50+00 Build branch: release-17.6 Build lane: release-17.6 Operating System Mac OS X 13.5.2 Darwin 22.6.0 Darwin Kernel Version 22.6.0 Wed Jul 5 22:22:52 PDT 2023 root:xnu-8796.141.3~6/RELEASE_ARM64_T8103 arm64 ```
rolfbjarne commented 1 year ago

Can you try something like this until this is fixed:

using ObjCRuntime;
public static nint MaximumResults {
    get {
        var lib = Dlfcn.dlopen ("/System/Library/Frameworks/CloudKit.framework/CloudKit", 0);
        return Dlfcn.GetIntPtr (lib, "CKQueryOperationMaximumResults");
    }
}