一个设备上能够存放多少个自定义 UIPasteboard
?我很好奇:1. 最大可创建的UIPasteboard
数量是多少,当达到MAX_NUMBER_OF_PASTEBOARDS
时,如果有人尝试将另一个UIPasteboard
添加到设备上会发生什么。
一个设备上能够存放多少个自定义 UIPasteboard
?我很好奇:1. 最大可创建的UIPasteboard
数量是多少,当达到MAX_NUMBER_OF_PASTEBOARDS
时,如果有人尝试将另一个UIPasteboard
添加到设备上会发生什么。
我为了回答你的问题进行了一个非常简单的实验:
NSMutableArray *array = [[NSMutableArray alloc] init];
while (1) {
[array addObject: [UIPasteboard pasteboardWithUniqueName]];
if (array.count%100000==0) {
NSLog(@"%d",array.count);
}
}
didReceiveMemoryWarning
警告,并最终导致为剪贴板分配内存的应用程序崩溃。