UIPasteboard size

廉价感情. 提交于 2019-12-01 06:46:11

问题


this is no longer relevant since iOS4+ - so please stop downvoting! or at least explain your downvotes

I am trying to do an upgrade path for a lite to full version of an application, that can store an indefinite amount of data (I dont want to do in app purchase).

I would like to be able to upgrade using a custom url without needing an online presence to cache the data to.

So was thinking of using a UIPasteboard object.

Does anyone know, or done any investigations on the max possible size of data stored to a UIPasteboard? There seems to be no apple documentation, that i can find, regarding this.

Will this vary from device to device? i.e. is it RAM limited?

I tried a 50MB file and know this fails (even in simulator) though a 5 MB file is OK. There is no way of knowing if it has failed until you come to get the data with dataForPasteboardType:

Also, has anyone done 2 app custom URLs that will do a kind of request/response inter app comms? I was thinking that i could support arbitrary sized data this way...


回答1:


I'll answer my own question, after doing some investigation, it's 8MB. Device independent.

I have also managed to support upgrade of arbitrarily large amounts of data using 2 custom URLs and the openURL method recursively between apps. Tested up to 100MB - it doesn't look too pretty because it opens each app 12 times!




回答2:


I'm surprised there's any limit. I don't see why/how there would be. You give UIPasteboard a dictionary with a retained pointer to your data. Who cares how big it is? I suspect if you are detecting a limit, it is really a limit on the size of an NSString, or NSData or whatever it is you're supplying to UIPasteboard.



来源:https://stackoverflow.com/questions/3520903/uipasteboard-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!