1

I have an application in which a user can upload recorded audio or video or picks an existing from library, pictures clicked or picked. I need that user to be able to view, say the last 50 uploaded items, for which I have made a screen called "Recent Additions" which has a table view which will be populated with those 50 items.

What options do I have?

  • I think that I have to add a local storage for it... If yes, how?
  • Can NSUserDefaults can help me?
  • When the user records/clicks/picks any asset, a URL is generated by system which I also use for uploading. Will the same URL I would need for saving that item in history?
eulr
  • 171
  • 2
  • 19
user2268539
  • 173
  • 2
  • 3
  • 14

1 Answers1

0

NSUserDefaults won't help you. That's meant for populating text fields and small tasks-- certainly not writing to disk.

To save a video or photo to your the iPhone out of app, you could just use UIActivityViewController and save to camera role after making an NSData instance. That's only if you are supporting iOS 6 and higher, however.

If you could want to save the media to the device's camera roll, you could make an NSData instance, use UIImagePNGRepresentation (if it's an image), make an instance of UIImage with the data, and finally use UIImageWriteToSavedPhotosAlbum.

For in-app writing to disk, check out Apple's docs on NSCoding and NSFileManager.

eulr
  • 171
  • 2
  • 19