Pregunta

The general NSPasteboard stores stuff that the user has copied. For example, like 100 images and 1000 words. Is there a limit to the size of the general NSPasteboard such that the user can copy say.. 99 images maximum?

What defines this limit? RAM or HD or ..?

¿Fue útil?

Solución

Yes.

There's no documented enforced limit (that I could find) on the size of the pasteboard. However, everything is finite. If you copy too much stuff to any pasteboard (whether it's the general pasteboard, the Find pasteboard, a drag pasteboard, or any other), you'll either hit an undocumented limit or you'll drive the system into paging hell. (Even that last part isn't really guaranteed; the pasteboard uses RAM the last time I checked, but it theoretically could write to disk instead either now or in the future.)

If you plan on copying a large quantity of data, I suggest promising it instead. How you do that depends on whether you're using the older type-and-data-based API, or the newer item-based API. It's more work, but it means you'll only need to bring in that data when the user pastes it somewhere.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top