UIP limit

How many custom UIPasteboard can be stored on one device? I am curious to know: 1. What is the maximum number of UIPasteboard can be created and what will happen when MAX_NUMBER_OF_PASTEBOARDS is reached and someone tries to add another UIPasteboard to the device.

+4
source share
1 answer

I did a very simple experiment on your question:

 NSMutableArray *array = [[NSMutableArray alloc] init]; while (1) { [array addObject: [UIPasteboard pasteboardWithUniqueName]]; if (array.count%100000==0) { NSLog(@"%d",array.count); } } 

In short, it is limited by the amount of available memory on the device. This means that you get didReceiveMemoryWarning and, in the end, the application allocating memory for the clipboard will crash.

+3
source

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


All Articles