Is there an equivalent of -applicationDidReceiveMemoryWarning: on Mac

I am looking for the equivalent of the method -(void)applicationDidReceiveMemoryWarning:(UIApplication *)applicationavailable on the iPhone. So far I have not managed to find anything, but I would like to check before starting to write my own.

+3
source share
4 answers

Memory on Mac OS X does not work the same as OS X Touch. It is noteworthy that the desktop computer has much more RAM and will replace the memory with a disk, because applications require more. In addition, there are many applications competing for resources.

The real question is what are you trying to accomplish?

, , , , , . ObjectAlloc , .

, , , , , , .

, API- , , , .

+7

​​ .

iPhone , . , ​​- , . iPhone .

, . , .

+2

, , Mac 1 (, 2 4+). malloc / , , , .

, , . Mac , iPhone, .

0

As far as I know, there is no direct equivalent. Perhaps you could check if objects were highlighted, and then send a notification so that other parts of your application can listen.

In practice, most applications do not bother. In situations where you are actually starting to not allocate objects (virtual memory is exhausted, the boot disk is full, etc.), you will probably encounter a failure anyway.

0
source

Source: https://habr.com/ru/post/1719170/


All Articles