I have a large file that I receive through a web service that I am trying to write to disk. I can write most files to disk, but this and other files of this size (or greater) seem to be causing issues. The app will crash when I try to convert the string of bits to NSData after receiving memory warnings. Here's the code I am using:
NSString *bits = /*string of file stream*/;
NSData *fileData = [[NSData alloc] initWithBase64EncodedString:bits options:0];
The app will crash when trying to create the fileData variable. Is there a standard to doing this process that I may not be following or is there a trick to working with large files?
Thank you in advance! This issue has been really bothering me.
A Little More Information
It seems accessing the bits string too often will cause the crash due to the large amount of data in the file stream string. I'm not too sure how to deal with this.