Note that writing NSData to a file is an I / O operation that can block the main thread. Especially if the data object is large.
Therefore, it is recommended to do this on a background thread, the easiest way would be to use a GCD as follows:
Tom Susel May 26 '14 at 6:09 a.m. 2014-05-26 06:09 a.m.
source share