3

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...

Nick Hingston
  • 8,724
  • 3
  • 50
  • 59

2 Answers2

6

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!

Nick Hingston
  • 8,724
  • 3
  • 50
  • 59
1

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.

Craig
  • 3,253
  • 5
  • 29
  • 43
  • 1
    It was a while since i did this investigation, though my understanding is the dictionary has to do a deep copy to shared memory (dictionaries have to be standard property list format), as each application is sandboxed - otherwise this could be a way of accessing protected memory space of another app...(but you are right, i was passing NSData objects, as i was copying a file) – Nick Hingston Oct 20 '11 at 10:29
  • Anybody able to confirm if it is deep copy or shallow copy? Thanks! http://stackoverflow.com/questions/18778213/is-data-handed-over-to-uipasteboard-deep-copy-or-shallow-copy – Ravindranath Akila Sep 13 '13 at 04:13