2012-03-28 44 views
4

多少定製UIPasteboard s時,可以存儲在單一設備上我很好奇,想知道:1.什麼的UIPasteboard最大數量可以創建和會發生什麼當達到MAX_NUMBER_OF_PASTEBOARDS並有人試圖添加其他UIPasteboard添加到設備。UIPasteboard限制

回答

3

我進行了你的問題很簡單的實驗:

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

長話短說,它是由可用內存設備上的量的限制。這意味着你會得到didReceiveMemoryWarning,最終,爲剪貼板分配內存的應用程序將崩潰。