Where do I find the namespace containing wrapper for function os_proc_available_memory(), or equivalent, for iOS?

Kurt K 136 Reputation points
2023-09-01T02:58:39.26+00:00

I submitted a similar question in 2021 for Xamarin.iOS: "Xamarin.iOS: Where do I find the namespace containing wrapper for function os_proc_available_memory() in Apple's "OS" framework?"

The answer at that time was that particular API is not exposed in Xamarin.iOS.

Today's question is for .NET Maui, and I added "or equivalent" to the question in case there is some other API for iOS to accomplish the same thing. The documentation for os_proc_available_memory() says: "Call this function to determine the amount of memory available to your app."

Thank you.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,418 questions
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 64,396 Reputation points
    2023-09-03T01:41:39.6433333+00:00

    You need a binding project. Maui uses the mono binding tools.

    https://www.mono-project.com/docs/advanced/pinvoke/

    currently Maui can only call objective-c apis.

    A video

    https://www.youtube.com/watch?v=oibfI-ZsmzQ

    note: iOS uses the Mach kernel.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.