Recently I wrote an app to collect data from iPhone. However the app crashed after a random period of time which made my classmates sad. But finally, we found out where the bug is !!!!!
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flagDescription
The parameter atomically, I set NO from the Internet. However, it crashed when multiple writes happened. So setting atomically YES is essential for multiple threads!!!!!!!!