问题
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