I am working on a project where I have to upload a large video to a server. I tried to hold the video in a variable. I am currently doing it using below code.
NSData *data=[NSData dataWithContentsOfFile:self.path];
It works on small video. But my app crashes when the video exceed the size 200-500 MB. I have hold video in a variable to provide upload functionality to different social networking sites and dropbox.
The message I get is Terminated due to Memory Error.
Please advice. How can I achieve this.
Edited
I have to hold video in NSData because I need to upload the video in different social networking sites such as Facebook, Dropbox, Google Drive etc through there API's. There APIs uses NSData for holding the binary data of the video. So I believe I can not use AFNetworking, NSInput Stream or any other mechanism here.