What would be the best way to write log statements to a file or database in an iPhone application?
Ideally, NSLog() output could be redirected to a file using freop
This code works for me:
- (void)applicationDidFinishLaunching:(UIApplication *)application { #if TARGET_IPHONE_SIMULATOR == 0 freopen([@"/tmp/my_logs.txt" fileSystemRepresentation], "w", stderr); #endif }