Share via

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

Kurt K 176 Reputation points
Sep 1, 2023, 2:58 AM

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.
4,058 questions
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 73,581 Reputation points
    Sep 3, 2023, 1:41 AM

    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.